MCP Admin API
The@agentium/transport package provides admin REST endpoints for managing MCP servers and the toolkit catalog at runtime. This enables UI-driven configuration — users can add MCP servers, connect them, and have their tools automatically available to agents.
Setup
Option 1: Via createAgentRouter
Enable admin routes with a single flag:
Option 2: Standalone admin router
For more control, usecreateAdminRouter directly with a shared MCPManager:
Option 3: Shared MCPManager with agent
Share theMCPManager between admin routes and your agent so tools stay in sync:
MCP Server Endpoints
List servers
Add a server
string
required
Server name. Also used as the default
id.'stdio' | 'http' | 'sse'
required
Transport protocol.
string
Server URL (required for
http and sse transports).string
Command to spawn (required for
stdio transport).string[]
Command arguments (
stdio only).Record<string, string>
Custom HTTP headers for authentication.
string
Custom server ID. Defaults to
name.boolean
default:"true"
Automatically connect after adding. Set
false to add without connecting.Get server details
Connect a server
Disconnect a server
Remove a server
Get tools from a server
Get all tools (all connected servers)
Toolkit Catalog Endpoints
The admin router also exposes the toolkit catalog, allowing UIs to list available toolkit types and instantiate them with configuration.List toolkits
Get toolkit details
Instantiate a toolkit
configFields schema for the toolkit. Returns the instantiated toolkit’s name and tools.
Server Status Values
Full Example: Chat UI with MCP Management
Seeexamples/toolkits/mcp-chat-ui.ts for a complete working example that combines:
- Dynamic MCP server management from the browser
- Streaming chat with SSE
- MongoDB-backed conversation memory
- Per-session cost tracking