Overview
Model Context Protocol (MCP)
MCP is an open standard developed by Anthropic that defines how AI models communicate with external tool servers. Agently uses MCP as its primary integration layer for powerful, safe connections to GitHub, Linear, Notion, and many more services.
Why MCP?
Before MCP, every AI tool needed its own custom integration layer — a different API shape, different auth model, different error handling. MCP standardizes all of this:
- ✓Consistent tool interface — every MCP server exposes tools the same way, so Agently knows how to call them without custom code.
- ✓Growing ecosystem — hundreds of MCP servers are available for popular tools, and the number grows weekly.
- ✓Composable — connect multiple MCP servers in a single conversation. The agent chooses the right tool for each step.
- ✓Safe by design — MCP servers run as separate processes with their own auth. Agently never needs your credentials directly.
How MCP Works in Agently
You configure an MCP server
Add a built-in server (GitHub, Linear, etc.) or point to any custom MCP-compatible server. Provide auth credentials.
Agently starts the server process
For stdio-based servers, Agently spawns the process locally. For HTTP-based servers, it connects to the running endpoint.
Server advertises its tools
During the MCP handshake, the server sends a list of available tools with names, descriptions, and parameter schemas.
Agent uses tools in conversations
When you include an MCP source in a conversation, the agent can call any of its tools. In Ask to Edit mode, write operations require your approval.
Results flow back to the agent
Tool results are returned to the AI model as structured data, which it uses to continue the conversation.
MCP Transports
MCP supports two transport mechanisms:
stdio
Agently spawns the server as a local subprocess and communicates over stdin/stdout. Most common for npm/npx-based servers.
{
"transport": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"]
}HTTP + SSE
Server runs independently (locally or remotely) and Agently connects via HTTP. Good for servers that need to stay running between sessions.
{
"transport": "sse",
"url": "http://localhost:3000/mcp"
}Building a Custom MCP Server
The MCP SDK is available for TypeScript/JavaScript and Python. A minimal server:
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({ name: "my-server", version: "1.0" });
server.tool(
"get-weather",
"Get current weather for a city",
{ city: z.string().describe("City name") },
async ({ city }) => {
const data = await fetchWeather(city);
return { content: [{ type: "text", text: JSON.stringify(data) }] };
}
);
const transport = new StdioServerTransport();
await server.connect(transport);Once built, configure your server in Agently pointing to your script and it will appear in the Sources list.
Resources
- modelcontextprotocol.io — Official MCP specification and documentation
- github.com/modelcontextprotocol/servers — Official reference server implementations
- MCP Servers in Agently — How to add and configure MCP servers