Skip to main content

Crate spn_mcp

Crate spn_mcp 

Source
Expand description

spn-mcp: Dynamic REST-to-MCP wrapper library

This crate provides the core functionality for wrapping REST APIs as MCP tools.

§Architecture

~/.spn/apis/*.yaml → config::load_all_apis() → ApiConfig
                                                   ↓
                                           server::DynamicHandler
                                                   ↓
                                              MCP Server (stdio)

§Configuration Format

API configurations are YAML files in ~/.spn/apis/:

name: example
base_url: https://api.example.com/v1
auth:
  type: bearer
  credential: example
tools:
  - name: get_data
    method: GET
    path: /data

Re-exports§

pub use config::ApiConfig;
pub use config::AuthConfig;
pub use config::AuthType;
pub use config::ToolDef;
pub use error::Error;
pub use error::Result;
pub use openapi::parse_openapi;
pub use openapi::OpenApiError;
pub use openapi::OpenApiSpec;

Modules§

config
Configuration module for spn-mcp.
error
Error types for spn-mcp.
openapi
OpenAPI 3.0+ parsing and conversion to API wrapper config.
server
MCP server module.