MCP
Weftra speaks the Model Context Protocol in both directions. Each project can be an MCP server whose tools are your flows. Inside a flow, the MCP Tools component connects to other MCP servers and hands their tools to an agent.
Weftra as an MCP server
Section titled “Weftra as an MCP server”Flows with mcp_enabled = true become tools. Components, as opposed to flows, never do.
| Transport | Endpoint |
|---|---|
| Streamable HTTP, all your MCP-enabled flows | POST /api/v1/mcp/streamable |
| Legacy SSE, all your MCP-enabled flows | GET /api/v1/mcp/sse, then POST /api/v1/mcp/?session_id= |
| Streamable HTTP, one project | POST /api/v1/mcp/project/{project id}/streamable |
| Legacy SSE, one project | GET /api/v1/mcp/project/{project id}/sse, then POST /api/v1/mcp/project/{project id}/?session_id= |
Streamable HTTP issues an Mcp-Session-Id on initialize. DELETE ends the session. A GET with a session is an SSE stream that sends notifications/tools/list_changed.
Supported methods: initialize, ping, tools/list, tools/call and notifications/*. Resources and prompts are not supported.
- The tool name is the snake-cased
action_name, or the flow name. It is at most 46 characters, and collisions get_2,_3. - The description is
"<flow id>: <action description or flow description>". - The input schema has
input_value,session_id, and the visible fields of the flow’s input components. - A failing flow returns a result with
isError: true. An unknown tool is JSON-RPC error-32602. - Tool calls go through the normal run path, so they are stored like
/api/v1/runcalls. A flow that pauses for human input becomes a suspended job.
Choosing which flows are tools
Section titled “Choosing which flows are tools”The studio does not have an MCP sidebar or publish dialog yet; both are planned. For now, use the project API:
GET /api/v1/mcp/project/{project id}returns {tools, auth_settings, server_name} for the project’s flows.
PATCH /api/v1/mcp/project/{project id}Content-Type: application/json
{ "settings": [ {"id": "<flow id>", "mcp_enabled": true, "action_name": "summarize_ticket", "action_description": "Summarize a support ticket"} ], "auth_settings": {"auth_type": "apikey"}}auth_type is none or apikey. With apikey, the project’s MCP endpoints need real credentials. A request that relies on auto-login is refused with 403.
The flow fields mcp_enabled, action_name and action_description can also be set with PATCH /api/v1/flows/{id}.
Connect a client
Section titled “Connect a client”Point an MCP client that supports Streamable HTTP at the project endpoint, and send your API key in the x-api-key header:
http://localhost:7860/api/v1/mcp/project/<project id>/streamableCalling other MCP servers from a flow
Section titled “Calling other MCP servers from a flow”MCP server configs
Section titled “MCP server configs”Store server configurations once under MCP servers in the home navigation (API: /api/v2/mcp/servers). A configuration is JSON, for example:
{ "url": "https://mcp.example.com/mcp", "headers": {"Authorization": "Bearer <token>"}}- Secrets in a configuration are encrypted at rest. They are masked when shown, and a masked value keeps the stored secret when you save.
- Status checks (
?action_count=true) probe Streamable HTTP servers only. Stdio servers are not started for a check, and legacy SSE servers are reported as unprobed. - Stdio servers run local commands. Only superusers can register them, and only when the server runs with
--allow-mcp-stdio. - URLs go through the outbound destination policy. Loopback, private, link-local and cloud-metadata addresses are refused unless the server runs with
--allow-private-destinations.
The MCP Tools component
Section titled “The MCP Tools component”MCP Tools (MCPTools) connects to an MCP server and exposes its tools.
mcp_serveris the name of a stored server config (resolved for the run’s user), a{name, config}object, or a barehttp(s)URL.- Transports: Streamable HTTP, legacy SSE, and stdio for configurations the server allows.
- The
toolsoutput feeds an agent’s tools port. Theresponseoutput calls one selected tool directly. - Other fields:
headers,api_key(sent as a Bearer token to HTTP servers),tool_prefix,tool_execution_timeout,verify_sslanduse_cache.
Weftra is open source under Apache-2.0. Made by Liceron.