# Hosted MCP servers

> Scaffold Streamable HTTP MCP servers in Node, Go, or Python, lock down every tool behind gregale-mcp.json allowlists, scale to zero between agent sessions, and monitor readiness continuously.

Category: AI & MCP · Maturity: Beta · Plans: Hobby, Pro, Scale · Updated 2026-11-26

Remote Model Context Protocol servers sit idle between agent bursts yet need strict tool authorization and health verification before Claude, Cursor, Codex, or VS Code connect. Gregale treats MCP hosting as a first-class workload with official starters, protocol checks, and zero-idle billing.

## Scaffold a Streamable HTTP MCP server and lock down tool allowlists

```bash
# Create a Node, Go (--runtime go), or Python (--runtime python) MCP server
gregale mcp server init --path ./my-mcp

# gregale-mcp.json — unlisted tools are hidden and refused with 403 tool_access_denied
# {
#   "auth": {
#     "tool_scopes": { "lookup": [], "greet": [] }
#   }
# }
```

## Key capabilities

- **Official Node, Go & Python starters:** Generate a working Streamable HTTP server at /mcp in seconds with sample tools, resources, prompts, health checks, and drain handlers wired.
- **Fail-closed tool, resource & prompt allowlists:** Every exposed capability must be listed in gregale-mcp.json (tool_scopes, resource_scopes, prompt_scopes). Unlisted tools are hidden and rejected with 403 tool_access_denied.
- **Scale-to-zero between agent calls:** Hosted MCP servers run in isolated Firecracker microVMs that park at $0 between sessions and wake on demand without idling GPUs or VM instances.
- **Protocol diagnostics & readiness checks:** Each new deployment runs MCP verification before taking live traffic, paired with readiness monitoring and optional PostgreSQL-backed durable MCP Tasks (Preview).

## Typical PaaS vs. Gregale

| Capability | Typical PaaS | Gregale |
|---|---|---|
| Idle MCP server billing | Fixed monthly container charge even between sessions | Parks to $0 idle between agent calls; wakes on /mcp requests |
| Per-tool allowlists & scoping | Hand-rolled auth middleware inside server code | Declarative gregale-mcp.json scope maps enforced per tool |
| Account management via MCP + guardrails | Direct destructive CLI tokens only | Plan -> Verify -> Approval -> Undo workflows for agent safety |

## Documentation

- [Host an MCP server](https://gregale.dev/docs/mcp-hosting.md)
- [Coding agents & MCP](https://gregale.dev/docs/agents.md)
- [Claude Code](https://gregale.dev/docs/claude-code.md)
- [Cursor](https://gregale.dev/docs/cursor.md)
- [Codex](https://gregale.dev/docs/codex.md)
- [Gemini CLI](https://gregale.dev/docs/gemini-cli.md)

## Related guides

- [mcp-server-hosting](https://gregale.dev/articles/mcp-server-hosting.md)
- [hosting-mcp-server-deploy-logs-rollback](https://gregale.dev/articles/hosting-mcp-server-deploy-logs-rollback.md)
- [best-cloud-for-ai-coding-agents](https://gregale.dev/articles/best-cloud-for-ai-coding-agents.md)

## Research

- [agent-ops-guardrails-matrix-2026-11-25](https://gregale.dev/research/agent-ops-guardrails-matrix-2026-11-25.md)

## Runnable starters on GitHub

- [Remote MCP Server in Node.js](https://github.com/gregale-dev/mcp-server-node) (Node 22 · Streamable HTTP MCP): Stateless Streamable HTTP MCP server built on the official TypeScript SDK with external OAuth, per-tool scopes, SSE progress, and AGENTS.md.
- [Remote MCP Server in Python](https://github.com/gregale-dev/mcp-server-python) (Python 3.13 · Streamable HTTP MCP): Stateless Streamable HTTP MCP server in Python with PyJWT external OAuth, JSON Schema tool validation, resource subscriptions, and AGENTS.md.
- [Remote MCP Server in Go](https://github.com/gregale-dev/mcp-server-go) (Go 1.26 · Streamable HTTP MCP): Stateless Streamable HTTP MCP server using modelcontextprotocol/go-sdk with JWKS external OAuth, per-tool allowlists, and AGENTS.md.
- [Gregale Plugin for Antigravity](https://github.com/gregale-dev/gregale-antigravity-plugin) (Antigravity Plugin · Hosted MCP): Connects Antigravity to https://api.gregale.dev/mcp with deploy and diagnose skills plus plain-Markdown operational rules.
- [Gregale Plugin for Claude Code](https://github.com/gregale-dev/gregale-claude-code-plugin) (Claude Code Plugin & Marketplace): Claude Code plugin marketplace configuring https://api.gregale.dev/mcp, deploy/diagnose skills, and CLAUDE.md guardrails.
- [Gregale Plugin for Cursor](https://github.com/gregale-dev/gregale-cursor-plugin) (Cursor Plugin · Hosted MCP): Deploy, inspect logs, diagnose regressions, and roll back releases directly from Cursor over OAuth-scoped hosted MCP.

Browse all starters: https://gregale.dev/templates.md

## Frequently asked questions

### Which MCP transport and runtimes does Gregale support?

Gregale hosts Streamable HTTP MCP servers at /mcp and provides official starters via gregale mcp server init for Node.js, Go (--runtime go), and Python (--runtime python).

### What happens if an MCP tool is registered in code but omitted from gregale-mcp.json?

The scope maps act as allowlists. Any tool missing from auth.tool_scopes (or resource_scopes / prompt_scopes) is hidden from callers and rejected with 403 tool_access_denied.

### Can coding agents also manage my Gregale apps safely over MCP?

Yes. Gregale exposes a hosted management MCP endpoint (https://api.gregale.dev/mcp) with OAuth, dry-run deploy diffs, canary verification, approval gates, and single-command undo.

Canonical URL: https://gregale.dev/features/mcp-hosting
