Connecting MCP Servers to Facio: A Practical Guide
The Model Context Protocol (MCP) has become the standard way for AI agents to connect to external tools and services. Facio supports MCP natively — add a server, and its tools become available to your agents instantly. This guide walks through the practical steps.
What MCP Brings to Facio
MCP servers expose tools — functions that can be called, resources that can be read, and prompts that can be used — over a standardized protocol. When you connect an MCP server to Facio, every tool the server provides becomes callable by your agent, just like a built-in capability.
This means:
- Database tools → your agent can query databases directly
- API integrations → your agent can interact with SaaS platforms
- File system tools → your agent can read and write files
- Browser tools → your agent can navigate the web
- Custom business logic → your agent can trigger internal workflows
Facio ships with several built-in MCP servers (browser, file tools, cron). Adding community or custom servers extends this further.
Adding an MCP Server to Facio
Use the manage_mcp tool to register a new server. Here's the basic pattern:
{
"action": "add",
"name": "my-server",
"config": {
"command": "npx",
"args": ["-y", "@org/mcp-server-name"]
}
}
For a Python MCP server:
{
"action": "add",
"name": "python-mcp",
"config": {
"command": "python",
"args": ["-m", "my_mcp_server"]
}
}
For HTTP-based MCP servers (e.g., hosted on a remote endpoint):
{
"action": "add",
"name": "remote-mcp",
"config": {
"url": "https://my-mcp-server.example.com/mcp"
}
}
After adding, enable the server with manage_mcp(action="enable", name="my-server") and restart it if needed.
Real Example: Blotato Social Media API
Blotato provides an MCP server for social media scheduling. The connection looks like:
{
"action": "add",
"name": "blotato",
"config": {
"url": "https://mcp.blotato.com/mcp",
"headers": {
"Authorization": "Bearer ${credentials.BLOTATO_API_KEY}"
}
}
}
Once connected, the agent can schedule posts, check publishing status, and manage social media operations — all through natural language instructions to Facio.
MCP Server Discovery
Where to find MCP servers:
- Glama MCP Registry: glama.ai/mcp/servers — trending servers with community ratings
- mcpservers.org: Community-curated directory
- Hacker News: Search
site:news.ycombinator.com "Show HN" MCP serverfor newly released servers - GitHub: Search for
mcp-servertopics for open-source implementations - Payload CMS MCP: github.com/your-org/payload-mcp — CMS integration via MCP
Configuration Best Practices
Security
- Run MCP servers that handle sensitive data with minimal permissions
- Use
enabled_toolsto restrict which tools the agent can access
{
"action": "edit",
"name": "my-server",
"updates": {
"enabled_tools": ["read", "search"]
}
}
Timeout Management
- Set
tool_timeout(seconds) for servers with potentially slow operations - The default is generous, but API calls or database queries may need tuning
{
"action": "edit",
"name": "my-server",
"updates": {
"tool_timeout": 120
}
}
Environment Variables
For servers that need API keys or config, pass them via the env field:
{
"action": "add",
"name": "secure-server",
"config": {
"command": "node",
"args": ["./server.js"],
"env": {
"API_KEY": "${credentials.MY_API_KEY}",
"REGION": "eu-west-1"
}
}
}
Troubleshooting
Server won't start: Check that the binary (npx, python, etc.) is available and the package is installed. Use exec to test the command manually first.
Tools not appearing: After adding and enabling, use manage_mcp(action="restart", name="...") to reload the connection.
Timeouts: Increase tool_timeout or check if the MCP server has a long initialization phase.
Authentication errors: Verify the server supports header-based auth (for HTTP) and that credentials are correctly stored via ask_form with password fields.
Building Your Own MCP Server
Facio supports the standard MCP protocol. Any MCP-compatible server works. For Python, FastMCP is the fastest path:
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("my-tool")
@mcp.tool()
def query_database(query: str) -> str:
"""Run a SQL query against the analytics DB"""
# implementation
return result
mcp.run()
Then connect it:
{
"action": "add",
"name": "analytics-mcp",
"config": {
"command": "python",
"args": ["/path/to/server.py"]
}
}
Key Takeaways
- Facio natively supports MCP — tools from any connected server become available to your agents
- Three transport modes: local process (command), HTTP endpoint (url), and hybrid
- Use
enabled_toolsto restrict agent access andtool_timeoutfor slow operations - Store API keys in Facio's credential system (never in plaintext config) and reference via
${credentials.KEY} - Any MCP-compatible server works — build your own with FastMCP in Python or the TypeScript SDK
MCP specification: modelcontextprotocol.io · MCP server registry: glama.ai/mcp/servers · Facio docs: facio.bot/docs