-
-
Notifications
You must be signed in to change notification settings - Fork 4
MCP
Model Context Protocol integration for local stdio servers and remote HTTP/SSE servers.
Refact’s MCP integration connects the agent to external MCP servers using the Rust SDK (rmcp). The engine supports stdio, SSE / streamable HTTP, and OAuth-based authentication for HTTP transports.
The engine has separate transport initializers for local and remote servers:
- stdio: launches a process and connects over stdin/stdout
- SSE / streamable HTTP: connects to a remote endpoint and streams events
- streamable HTTP: used by the HTTP transport implementation in the current engine code
- OAuth 2.0 PKCE and client credentials: supported via the MCP auth layer
The default request headers include a Refact User-Agent string:
User-Agent: Refact.ai (+https://github.com/JegernOUTT/refact)
MCP tools are discovered lazily so the agent does not flood every request with every remote schema, prompt, and resource.
The intended flow is:
- search for a tool with
tool_search - call it with
mcp_call
That keeps tool registration lightweight until a specific server capability is actually needed.
Project-local MCP configs live under:
.refact/integrations/*.yaml
The engine also documents the same integration family in AGENTS.md and exposes integration configuration through the GUI and HTTP API.
The MCP integration includes support for:
- tool registration and execution
- resources
- prompts
- sampling
- auth token persistence and refresh
- session state and reconnection settings
src/integrations/mcp/integr_mcp_stdio.rssrc/integrations/mcp/integr_mcp_sse.rssrc/integrations/mcp/integr_mcp_http.rssrc/integrations/mcp/mcp_auth.rssrc/integrations/mcp/mcp_prompts.rssrc/integrations/mcp/mcp_resources.rssrc/integrations/mcp/session_mcp.rssrc/integrations/mcp/tool_mcp.rs
The MCP setup UI uses schema files such as mcp_stdio_schema.yaml, mcp_sse_schema.yaml, mcp_http_schema.yaml, and mcp_unified_schema.yaml to describe user-facing settings.
See also: Integrations, Agent Tools
Refact on GitHub: https://github.com/JegernOUTT/refact
- Agent Modes
- Agent Tools
- Task Planner & Cards
- Worktrees
- Subagents
- Memory & Knowledge
- Hidden Roles & Plans
- Context Compression
- Scheduler & Cron
- Processes & PTY
- Buddy
- MCP
- Skills, Commands & Hooks
- Marketplace
- Chat System
- Providers
- Caps & Models
- Code Completion (FIM)
- AST
- VecDB
- Exec Runtime
- HTTP API
- Checkpoints & Git
- Voice