Expand description
Runtime library for config-driven MCP servers.
pmcp-server-toolkit lifts the operational glue that pmcp-run servers
share — auth providers, secrets resolution, static resources/prompts,
a [[tools]] synthesizer, and code-mode wiring — into the public SDK.
Phase 83 ships the empty crate skeleton; subsequent plans land the functionality across these modules:
auth—AuthProviderimplementations (StaticAuthProvider,BearerAuthProvider).secrets—SecretsProvidertrait + env/AWS implementations and theSecretValuenewtype that never leaks viaDebug/Display/Serialize.config—ServerConfigtypes with#[serde(deny_unknown_fields)]strictness.prompts—StaticPromptHandleradapter for static prompt templates.resources—StaticResourceHandleradapter for shipped resources.tools—synthesize_from_configbuilder turning[[tools]]into runtime handlers.sql—SqlConnectortrait + dialect enum for backend-agnostic SQL toolkits.builder_ext—ServerBuilderExtextension methods onpmcp::ServerBuilder.code_mode(featurecode-mode) — re-exports frompmcp-code-modeplus toolkit glue.error—ToolkitErrorenum and the crate-levelResult<T>alias.
The public module set is locked by Phase 83 decision D-15. See the
.planning/phases/83-toolkit-core-lift-pmcp-server-toolkit/ design log for
the architectural responsibility map and review notes.
Re-exports§
pub use error::Result;pub use error::ToolkitError;pub use crate::auth::StaticAuthProvider;pub use crate::secrets::EnvSecrets;pub use crate::secrets::SecretValue;pub use crate::secrets::SecretsProvider;pub use crate::secrets::SecretsProviderChain;pub use crate::secrets::OrgSecretsManagerProvider;pub use crate::secrets::SecretsManagerSecrets;pub use crate::secrets::SsmSecrets;pub use crate::resources::StaticResourceHandler;pub use crate::prompts::StaticPromptHandler;pub use crate::prompts::prompt_handlers_from_config;pub use crate::config::ServerConfig;pub use crate::error::ConfigValidationError;pub use crate::tools::synthesize_from_config;pub use crate::tools::synthesize_from_config_with_connector;pub use crate::tools::synthesize_from_config_with_http_connector;pub use crate::tools::synthesize_from_config_with_http_connector_and_scripts;pub use crate::builder_ext::ServerBuilderExt;pub use crate::sql::ConnectorError;pub use crate::sql::Dialect;pub use crate::sql::SqlConnector;pub use crate::http::HttpConnector;pub use crate::http::HttpConnectorError;pub use crate::http::Operation;pub use crate::code_mode::assemble_code_mode_prompt;pub use crate::code_mode::assemble_code_mode_prompt_with_schema;
Modules§
- auth
AuthProviderimpls for the toolkit — bearer-token-based static auth suitable for dev/test environments. Production callers should use pmcp’s OAuth/JWT providers instead.- builder_
ext - Builder extension trait for
pmcp::ServerBuilder— connects config-driven synthesis (Plans 04, 05, 06) to the public Phase 82 builder API. - code_
mode - Code-mode wiring: bridges
[code_mode]config blocks into pmcp-code-mode’s validation pipeline + HMAC token machinery, with policy / executor / validation types re-exported verbatim (NO duplicate impl per RESEARCH §“Anti-Patterns” #2). - config
ServerConfig+ sub-sections. Strict#[serde(deny_unknown_fields)]per D-13.- error
- Toolkit error type and crate-level
Resultalias. - http
- HTTP backend primitives for config-driven OpenAPI MCP servers (Phase 90).
- prompts
- Static MCP prompts for config-driven servers.
- resources
- Static MCP resources for config-driven servers.
- secrets
- Secrets management for the toolkit.
- sql
- SQL connector trait (3-method surface) + dialect enum.
- tools
[[tools]]→ToolInfo+Arc<dyn ToolHandler>synthesizer.
Traits§
- Auth
Provider - Core authentication provider trait. This is the main abstraction that MCP servers use for authentication.
Functions§
- demo_
db_ path - Resolve the writable filesystem path for the demo SQLite database.