MCP Integration
Connect external tools via Model Context Protocol servers.
What is MCP?
The Model Context Protocol (MCP)is an open standard for connecting AI agents to external tools and data sources. Franklin supports MCP natively — any MCP server can be plugged in as a tool provider.
Server Discovery
Franklin discovers MCP servers from three locations, checked in order. Later sources override earlier ones:
- Built-in — the
blockrunMCP server ships with Franklin and provides access to BlockRun's API gateway (search, wallet, markets, models). - Global —
~/.blockrun/mcp.json. Servers defined here are available in every project. - Project —
.mcp.jsonin the project root. Scoped to the current project only.
Configuration Format
Both ~/.blockrun/mcp.json and .mcp.json use the same format:
{
"mcpServers": {
"my-server": {
"command": "npx",
"args": ["-y", "@example/mcp-server"],
"env": {
"API_KEY": "your-key"
}
}
}
}Transports
stdio (default)
The most common transport. Franklin spawns the MCP server as a child process and communicates over stdin/stdout.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/docs"]
}
}
}HTTP (SSE)
For remote MCP servers, use HTTP with Server-Sent Events. Specify a url instead of command:
{
"mcpServers": {
"remote-tools": {
"url": "https://mcp.example.com/sse",
"headers": {
"Authorization": "Bearer your-token"
}
}
}
}Auto-wrapping
CapabilityHandlers. The agent sees them alongside built-in tools with no extra configuration. Tool names are prefixed with the server name (e.g., mcp__filesystem__read_file).Using MCP Tools
Once configured, MCP tools are immediately available. The agent discovers them on startup and can call them like any built-in tool. To see which MCP servers are connected:
# Inside a Franklin session
/mcpThis lists all connected MCP servers and their available tools.
Example: Adding a Database Server
Add a PostgreSQL MCP server so Franklin can query your database:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost:5432/mydb"
}
}
}
}Save this to .mcp.json in your project root, then restart Franklin. The agent can now run SQL queries through the postgres tools.