References

MCP Protocol

How the Model Context Protocol works and how Ink uses it to give AI agents full control over infrastructure

What is MCP?

Model Context Protocol (MCP) is an open standard for connecting AI agents to external tools and data sources. Instead of building custom integrations for each AI client, a service exposes MCP tools once and every compatible client can use them.

MCP defines a simple contract: the server advertises a list of tools with typed parameters, and the client (your AI agent) calls those tools during conversation. The agent decides when to call which tool based on your instructions and the tool descriptions.

Prompt

Deploy a React app to production

Agent thinks: I need to create a service on Ink

Tool Call
(
  "name": "my-app",
  "repo": "ink/my-app"
)

Agent thinks: Let me check if the build succeeded

Tool Call
(
  "name": "my-app",
  "deploy_log_lines": "50"
)
Agent: "Your app is live at my-app.ml.ink"

How Ink uses MCP

Ink exposes 22+ MCP tools through a single endpoint:

https://mcp.ml.ink/mcp

When your agent connects, it receives the full tool catalog — deploy services, provision databases, manage DNS, read logs, check metrics. The agent treats these tools the same way it treats file system operations or web searches: as capabilities it can invoke when needed.

Transport

Ink uses Streamable HTTP transport. The agent sends JSON-RPC requests over HTTP and receives responses (or streams) back. Most MCP clients handle this automatically — you just provide the endpoint URL.

Authentication

Two methods are supported:

  • OAuth — the agent authenticates through a browser flow. The MCP client handles the OAuth handshake automatically. This is the default for Claude Code, Cursor, and most desktop clients.
  • API Key — pass a dk_live_ token in the Authorization header. Designed for headless agents and programmatic access.

Tool discovery

On connection, the agent calls tools/list and receives every available tool with:

  • Name — the tool identifier (e.g., create_service)
  • Description — what the tool does, written for AI agents to understand
  • Input schema — typed parameters with descriptions and defaults
  • Required fields — which parameters are mandatory

The agent uses these descriptions to decide when and how to call each tool. Good tool descriptions are critical — they're the agent's documentation.

MCP vs REST APIs

MCPREST API
ConsumerAI agentsHuman developers writing code
DiscoveryAutomatic — agent reads tool listManual — developer reads docs
InvocationAgent decides based on contextDeveloper writes explicit calls
AuthOAuth or token, handled by clientDeveloper manages tokens
Error handlingAgent reads error, adapts approachDeveloper writes error handling code

MCP doesn't replace REST APIs — it's a layer designed for AI agent interaction. Ink's MCP tools call the same underlying API, but the interface is optimized for how agents think and operate.

Supported clients

Any MCP-compatible client works with Ink. Currently supported:

  • Claude Code — full OAuth support
  • Cursor — OAuth or token
  • VS Code (Copilot) — OAuth or token
  • Windsurf — token-based
  • OpenAI Codex — OAuth support
  • Gemini CLI — token-based
  • And 10+ more clients

See Agent Setup for detailed connection instructions for each client.

On this page