Skip to main content

What is MCP?

The Model Context Protocol (MCP) is a standardized way to connect AI agents to external tools and data sources. MCP servers expose tools that DeerFlow can automatically discover and integrate.
Learn more about MCP at modelcontextprotocol.io

MCP Capabilities

File Systems

Access local or remote file systems

Databases

Query PostgreSQL, SQLite, and other databases

External APIs

Integrate GitHub, Brave Search, and more

Browser Automation

Control browsers with Puppeteer

MCP Transport Types

DeerFlow supports three MCP transport mechanisms:
Standard input/output communication with a subprocess.Best for: Local command-line tools, Node.js scripts

Configuration

MCP servers are configured in extensions_config.json (separate from config.yaml).
1

Copy Example Configuration

2

Configure MCP Servers

Edit extensions_config.json:
extensions_config.json
3

Set Environment Variables

Set required API tokens in .env:
.env
4

Restart DeerFlow

MCP servers are loaded automatically on startup.

OAuth for HTTP/SSE Servers

For HTTP and SSE transport types, DeerFlow supports OAuth token acquisition and automatic refresh.

Supported Grant Types

OAuth 2.0 client credentials flow.
extensions_config.json

OAuth Configuration Options

DeerFlow automatically refreshes tokens before they expire based on refresh_skew_seconds.

Official MCP Servers

Access GitHub repositories, issues, and pull requests.
Get token: github.com/settings/tokens
Read and write files in allowed directories.
Only directories listed in args are accessible. Choose carefully for security.
Query PostgreSQL databases.
Web and local search using Brave.
Get API key: brave.com/search/api
Browser automation and web scraping.

Community MCP Servers

Find more servers in the MCP Servers Directory

Managing MCP Servers

Via API

Manage MCP configuration programmatically:

Dynamic Reloading

DeerFlow automatically detects changes to extensions_config.json:
  1. Edit extensions_config.json
  2. Save the file
  3. MCP manager detects file change
  4. New configuration loaded automatically
  5. Next agent run uses updated tools
No restart required when modifying extensions_config.json.

Creating Custom MCP Servers

Create your own MCP server:
1

Choose Language/Framework

MCP servers can be written in any language. Official SDKs:
  • Python: mcp package
  • TypeScript: @modelcontextprotocol/sdk
2

Implement MCP Protocol

server.ts
3

Package and Publish

package.json
Publish to npm or use locally.
4

Configure in DeerFlow

extensions_config.json

Security Considerations

MCP servers have access to sensitive resources. Configure carefully.

Best Practices

  1. Use Environment Variables for Secrets
    Never hardcode:
  2. Limit Filesystem Access
    Avoid:
  3. Disable Unused Servers
  4. Review Server Code
    • Check source code of community servers
    • Verify npm package authenticity
    • Use official servers when available

Troubleshooting

Check logs for errors:
Common issues:
  • Missing npm packages: npx will auto-install, but may fail
  • Invalid command path
  • Missing environment variables
  • Permission issues
Verify server is enabled:
Check available tools:
Verify:
  • Token URL is correct
  • Client ID and secret are valid
  • Scope is appropriate
  • Environment variables are set
Check logs for OAuth errors:
Add error logging to server code.Consider using http or sse transport instead of stdio for better error handling.Wrap server execution in a restart script:

Next Steps

Custom Tools

Learn about creating Python tools

Creating Skills

Build skills that use MCP tools

MCP Specification

Read the official MCP documentation

MCP Servers

Browse community MCP servers