Back to blog

Product · May 22, 2026

Connecting MCP Servers to Facio: A Practical Guide

Step-by-step guide to connecting MCP servers to Facio: adding, configuring, securing, and troubleshooting — with practical examples and best practices.

MCPIntegrationTutorialAgent ToolsDeployment

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 server for newly released servers
  • GitHub: Search for mcp-server topics 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_tools to 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_tools to restrict agent access and tool_timeout for 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

Keep reading

More on Product

View category
Aug 7, 2026Product

Facio's Async Processing Discipline: How AI Agents Handle Long-Running Tasks Without Blocking Conversations, Losing State, or Breaking the Customer Experience

AI agents process long-running tasks: data analysis, batch operations, model training, multi-stage workflows. The naive approach blocks the conversation until the task completes — the customer waits, the connection times out, the state is lost. Facio's async processing discipline gives agents structured mechanisms to handle long-running tasks without blocking: non-blocking task submission with submission metadata, state persistence with checkpointing, progress indication with multiple progress types, task recovery from transient and worker failures, and completion notification via registered channels.

Aug 6, 2026Product

Facio's System Prompt Discipline: How AI Agent Behavior Stays Bounded, Auditable, and Evolvable Without Becoming a Black Hole of Hidden Instructions

AI agents follow system prompts that define role, tool usage, output format, refusal patterns, escalation rules, and behavioral boundaries. The naive approach writes one giant unstructured prompt that becomes an ungovernable black box. Facio's system prompt discipline gives agents structured mechanisms to define, version, audit, test, and evolve the behavioral contract: prompt decomposition into named sections, per-section versioning with full history, audit capabilities showing what the agent was told and when, prompt testing for behavioral verification, and safe evolution via feature flags and rollout strategies.

Aug 5, 2026Product

Facio's Orchestration Discipline: How AI Agents Coordinate Multi-Step Workflows Without Losing Track, Running in Circles, or Breaking the Process

AI agents orchestrate multi-step workflows with tool calls, decisions, retries, branches, parallelism, and humans in the loop. The naive approach lets the agent decide at each step what to do next. The agent loses track. The agent runs in circles. Facio's orchestration discipline gives agents structured mechanisms to coordinate multi-step workflows reliably: workflow declaration with explicit steps, state tracking through execution, process enforcement against the declared definition, branching and parallelism for complex workflows, and recovery via checkpoints and compensation actions. The work gets done.