Skip to content
MCP Servers
MCP is how ProtoAgent grows beyond its built-in tools.
Instead of baking every possible tool into the app, you point ProtoAgent at one or more MCP servers and it discovers their tools at startup.
Configuration lives in merged protoagent.jsonc files under mcp.servers.
Supported server types
ProtoAgent currently supports:
stdioservers started as child processeshttpservers reached through Streamable HTTP transport
The implementation uses the official @modelcontextprotocol/sdk.
Stdio servers
jsonc
{
"mcp": {
"servers": {
"my-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@example/mcp-server"],
"env": {
"API_KEY": "your-key-here"
}
}
}
}
}Fields:
type: must be"stdio"command: executable to runargs: optional command-line argumentsenv: optional environment variablescwd: optional working directoryenabled: optional toggle
type is expected explicitly in the current implementation.
HTTP servers
jsonc
{
"mcp": {
"servers": {
"remote-server": {
"type": "http",
"url": "http://localhost:3000/mcp",
"headers": {
"Authorization": "Bearer ${MY_MCP_TOKEN}"
}
}
}
}
}Fields:
type: must be"http"url: full MCP endpoint URLheaders: optional request headers
What happens at startup
When ProtoAgent launches, it loads merged protoagent.jsonc config and:
- connects to each configured server
- calls
listTools()through the MCP client - registers each remote tool dynamically
- exposes them to the model with names like
mcp_<server>_<tool>
So if a server named github exposes a tool named search_docs, the model sees mcp_github_search_docs.
Tool results
When an MCP tool is called, ProtoAgent forwards the arguments with callTool() and flattens text content blocks into a single string result. Non-text blocks are JSON-stringified.
That flattening is a simplification, but it keeps the tool surface easy to work with in the current app.
Shutdown
On app cleanup, ProtoAgent closes MCP client connections.
Current limits
- OAuth support is not implemented
- tool results are flattened into strings rather than preserved as rich structured blocks