Skip to main content
MCP (Model Context Protocol) servers let you add external tools to pflow. Once added, your AI agent can use these tools in workflows - GitHub, Slack, databases, and more. pflow supports both local (stdio) and remote (HTTP) MCP servers.

Adding a server

From a config file

If you have an MCP config file (JSON format):
pflow mcp add ./github.mcp.json
Config file format:
{
  "github": {
    "command": "npx",
    "args": ["-y", "@github/mcp-server"],
    "env": {
      "GITHUB_PERSONAL_ACCESS_TOKEN": "your-token"
    }
  }
}

From JSON directly

For quick setup, pass JSON directly:
# Local stdio server
pflow mcp add '{"github": {"command": "npx", "args": ["-y", "@github/mcp-server"]}}'

# Remote HTTP server
pflow mcp add '{"slack": {"type": "http", "url": "https://mcp.example.com/slack"}}'

Multiple servers at once

Add multiple servers from separate files:
pflow mcp add ./github.mcp.json ./slack.mcp.json ./notion.mcp.json

Tools are auto-discovered

You don’t need to manually sync after adding a server. When your agent runs a workflow, pflow automatically discovers tools from any new or changed servers.
If you want to test the connection immediately after adding a server, run pflow mcp sync <server-name> to force discovery.

Managing servers

List configured servers

pflow mcp list

View available tools

See all tools from a specific server:
pflow mcp tools github
Or list all tools from all servers:
pflow mcp tools --all

Get tool details

See detailed information about a specific tool:
pflow mcp info mcp-github-create-issue

Remove a server

pflow mcp remove github

Configuration file location

pflow stores MCP server configurations in:
~/.pflow/mcp-servers.json
You can edit this file directly instead of using pflow mcp add. The file uses the standard MCP configuration format used by Claude Desktop, VS Code, and other MCP clients.

Server configuration format

Local (stdio) servers

Local servers run as subprocesses on your machine. The type field is optional and defaults to "stdio":
{
  "server-name": {
    "command": "npx",
    "args": ["-y", "@namespace/mcp-server"],
    "env": {
      "API_KEY": "your-key"
    }
  }
}
FieldRequiredDescription
commandYesThe command to run (e.g., npx, python, node)
argsNoCommand arguments
envNoEnvironment variables passed to the server

Remote (HTTP) servers

Remote servers connect over HTTP/SSE. The type field is required for HTTP servers:
{
  "server-name": {
    "type": "http",
    "url": "https://mcp.example.com/server",
    "headers": {
      "Authorization": "Bearer ${API_TOKEN}"
    }
  }
}
FieldRequiredDescription
typeYesMust be "http" for remote servers
urlYesThe server URL (SSE endpoint)
headersNoHTTP headers for authentication

Environment variable expansion

Use ${VAR} syntax to reference environment variables in your config:
{
  "github": {
    "command": "npx",
    "args": ["-y", "@github/mcp-server"],
    "env": {
      "GITHUB_TOKEN": "${GITHUB_TOKEN}"
    }
  }
}
Variables are resolved from two sources (in order of precedence):
  1. System environment - export GITHUB_TOKEN="your-token"
  2. pflow settings - pflow settings set-env GITHUB_TOKEN "your-token"
Use ${VAR:-default} for fallback values:
{
  "url": "${API_URL:-https://api.example.com}"
}
Variables are expanded at runtime when the server starts, not when the config is saved.

Using MCP tools in workflows

Once added, MCP tools become pflow nodes that your agent can use:
# Discover relevant tools
pflow registry discover "create github issues"

# See tool parameters
pflow registry describe mcp-github-create_issue
See MCP nodes for how these nodes work in workflows - naming convention, parameters, output format, and examples.
If you’re repeatedly calling the same API using the http node, consider having your agent create an MCP server for it. This turns one-off HTTP requests into reusable, discoverable tools.

Common MCP servers

Here are some popular MCP servers. Save any of these as a .json file and add with pflow mcp add ./filename.json:

GitHub

{
  "github": {
    "command": "npx",
    "args": ["-y", "@github/mcp-server"],
    "env": {
      "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}"
    }
  }
}
See github/github-mcp-server for full documentation. pflow also has built-in github nodes but they’re experimental and disabled by default.

Filesystem

For basic file operations, pflow includes built-in file nodes - no MCP server needed. The filesystem MCP server is useful for advanced operations or stricter directory sandboxing. If you do use it, consider disabling the built-in file nodes to avoid confusion: pflow settings deny "pflow.nodes.file.*".
{
  "filesystem": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/directory"]
  }
}
{
  "brave-search": {
    "command": "npx",
    "args": ["-y", "@brave/brave-search-mcp-server"],
    "env": {
      "BRAVE_API_KEY": "${BRAVE_API_KEY}"
    }
  }
}
See Brave Search API for API key setup (free tier: 2,000 queries/month).
Find more MCP servers at the Official MCP Registry or the community-curated awesome-mcp-servers list.

Troubleshooting

  1. Check your JSON syntax is valid
  2. Make sure the config file path is correct
  3. Run pflow mcp list to see configured servers
  1. Check the server is running correctly: pflow mcp sync <server-name>
  2. Verify credentials/environment variables are set
  3. Check the server logs for errors
  1. Run pflow mcp info <tool-name> to see required parameters
  2. Check that required environment variables are set in the server config
  3. Verify the server has access to required resources (network, files, etc.)