neuron-mcp
Model Context Protocol (MCP) integration for the neuron agent blocks ecosystem.
Wraps the official Rust MCP SDK (rmcp) and bridges MCP tools, resources, and
prompts into neuron's type system. Provides both client and server
functionality.
Key Types
McpClient-- connects to MCP servers via stdio (connect_stdio) or Streamable HTTP (connect_http). Provides methods for listing and calling tools, reading resources, and fetching prompts.McpToolBridge-- bridges a single MCP tool to theToolDyntrait so it can be registered in aToolRegistryand used alongside native tools.McpServer-- exposes aToolRegistryas an MCP server, handlingtools/listandtools/callrequests.StdioConfig/HttpConfig-- connection configuration structs.PaginatedList<T>-- paginated response wrapper withitemsandnext_cursor.McpResource,McpResourceContents,McpPrompt-- MCP resource and prompt types.
Features
- Full MCP client: tools, resources, prompts, pagination.
- Full MCP server: expose any
ToolRegistryover stdio. - Automatic tool discovery via
McpToolBridge::discoverorMcpClient::discover_tools. - Supports both stdio (child process) and Streamable HTTP transports.
- Error types convert cleanly from
rmcp::ServiceErrortoMcpError.
Usage
use Arc;
use ;
use ToolRegistry;
async
Part of neuron
This crate is one block in the neuron
composable agent toolkit. It depends on neuron-types, neuron-tool, and
rmcp.
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.