ExuluMCP is a class that mounts Model Context Protocol (MCP) endpoints on an Express application. It turns each IMP agent’s enabled tools into MCP-registered tools, so external MCP clients (Claude Desktop, custom clients, etc.) can call those tools via the standard MCP Streamable HTTP transport.
ExuluMCP is used internally by ExuluApp — you do not need to instantiate it directly unless you are building a custom server that manages Express yourself.
Constructor
ExuluMCP instance. No configuration required at construction time; the MCP server for each agent is created lazily on the first request.
API surface
create
/mcp/:agent, where :agent is the agent’s ID.
Express
required
An initialized Express application.
ExuluTool[]
required
All registered tools. The handler filters to the agent’s enabled tools at request time.
ExuluProvider[]
required
All registered providers. Used to resolve the agent’s model.
ExuluContext[]
required
All registered contexts. Used to resolve context-bound tools.
ExuluConfig
required
The application config from
ExuluApp.Promise<Express>
The same Express instance with MCP routes added.
Endpoints
Aftercreate is called, three routes are active:
Sessions are tracked by the
mcp-session-id header. On the first POST without a session ID (an initialize request), a new session is created and the ID is returned in the response header.
Authentication and access control
Every request to/mcp/:agent is authenticated using the standard IMP authentication stack (API key or session token). Access to the agent is then verified with checkRecordAccess. Unauthenticated or unauthorized requests receive 401 / 404 before any MCP processing occurs.
Built-in prompt tools
In addition to the agent’s enabled tools, two tools are registered on every MCP server:getListOfPromptTemplates— lists prompt templates assigned to the agent (id, name, description).getPromptTemplateDetails— retrieves the full content and metadata of a specific template by ID.
Example
Enable MCP by settingMCP.enabled: true in your config when calling app.create(...). ExuluApp mounts the MCP routes automatically — no direct instantiation of ExuluMCP required.
An MCP client connecting to this server would use the URL:
Related
- ExuluApp — introduction:
ExuluAppsets up MCP automatically when the server starts. - ExuluTool — introduction: define the tools exposed through MCP.