Skip to main content

mcp-methods

Shared Rust-powered utilities for Model Context Protocol servers. Pip-installable Python library AND a native Rust crate AND a generic CLI binary — three distribution shapes, one set of primitives.

Fast file search (ripgrep-backed), GitHub integration with smart compaction, text utilities, and an rmcp-backed MCP server framework with YAML-manifest configuration. The common building blocks needed when writing MCP tool servers.

The Rust library is the source of truth; the Python wheel is a thin pyo3 binding over it. Rust consumers see zero pyo3 in their dep tree.

Install

Python — pip install

pip install mcp-methods
from mcp_methods import ElementCache, ripgrep, list_dir, github_discussions, read_file

The wheel ships the mcp-server CLI on PATH alongside the library — which mcp-server should resolve immediately. Single abi3 wheel per OS; works on Python 3.12 and later without reinstall.

Rust library — cargo add

[dependencies]
mcp-methods = "0.6"
use mcp_methods::cache::ElementCache;
use mcp_methods::{github, files, grep, list_dir, compact, html};
use mcp_methods::server::{McpServer, ServerOptions, Manifest}; // with default `server` feature

Zero pyo3 in the dep tree. The server feature (default-on) adds the rmcp-backed framework; disable with default-features = false for the bare primitives. mcp-methods requires Rust 1.88 or newer.

For pre-release coordination — pinning against a specific commit while the framework is iterating quickly — depend on a git rev:

mcp-methods = { git = "https://github.com/kkollsga/mcp-methods.git", rev = "<short SHA>", features = ["server"] }

The downstream kglite-mcp-server uses this pattern to stay locked to the exact framework rev its integration tests pass against.

CLI — cargo install (alternative path)

The CLI ships in the pip wheel by default. If you'd rather skip Python:

cargo install --git https://github.com/kkollsga/mcp-methods mcp-server

Not on crates.io — mcp-server is unpublished on purpose. The Rust library on crates.io is the published surface; the binary ships via the wheel and via git.

Documentation

Full docs at mcp-methods.readthedocs.io (Sphinx + Read the Docs, structured along Diátaxis lines):

  • Getting Started — 15-minute walkthrough from pip install to a running server
  • Core Concepts — manifest, operating modes, trust gates, downstream-binary pattern
  • Guides — writing a manifest, downstream binaries, trust gates, python bindings, watch + workspace modes
  • Reference — manifest schema, Python API, Rust API
  • Explanation — three-crate architecture, advisory-trust pattern, distribution shape

Rust API rustdoc: docs.rs/mcp-methods.

What's included

Primitive Purpose
list_dir Tree-formatted directory listing with depth, glob, .gitignore, annotation
ripgrep_files, ripgrep, ripgrep_lines Ripgrep-powered search (in-process, no subprocess)
read_file Safe file reading with path traversal protection
github_discussions, git_api GitHub issue/PR fetching with smart compaction, REST wrapper
ElementCache Drill-down cache for collapsed elements in GitHub discussions
html_to_text, compact_text, collapse_code_blocks Text utilities
extract_github_refs, detect_git_repo, validate_repo Git/GitHub helpers
mcp_methods.fastmcp Composable tool registrations for FastMCP servers
SkillRegistry, Skill, register_skills_as_prompts Operator-authored methodology as MCP prompts (layered: project → domain pack → manifest-inline → owned → bundled defaults). See crates/mcp-methods/dev-documentation/skills-aware-mcp.md for the design doc.

Plus the server framework in mcp_methods::server::*: McpServer, ServerOptions, Manifest, Workspace, watch_dir, load_env_walk, serve_prompts. See the Rust API reference.

License

MIT.

Metadata

Release files for mcp-methods 0.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for mcp-methods 0.6.3
File Interpreter ABI Platform Actions
mcp_methods-0.6.3-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for mcp_methods-0.6.3-cp312-abi3-win_amd64.whl
mcp_methods-0.6.3-cp312-abi3-manylinux_2_39_x86_64.whl CPython 3.12 abi3 Linux glibc 2.39+ x86-64 Details for mcp_methods-0.6.3-cp312-abi3-manylinux_2_39_x86_64.whl
mcp_methods-0.6.3-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for mcp_methods-0.6.3-cp312-abi3-macosx_11_0_arm64.whl

Total release size: 27.3 MB

Release files / mcp_methods-0.6.3-cp312-abi3-win_amd64.whl

Download URL mcp_methods-0.6.3-cp312-abi3-win_amd64.whl
Size 8.5 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c8ba7b056bbfbd9df86df0b3c56b5223806a413534b8d9f9c1adcf57e962b693
BLAKE2b-256 checksum
How to use checksums
c9789b72349fbb6cd3d8a0fd5479364902d91c64caf480d37acf4a4374c4b89a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / mcp_methods-0.6.3-cp312-abi3-manylinux_2_39_x86_64.whl

Download URL mcp_methods-0.6.3-cp312-abi3-manylinux_2_39_x86_64.whl
Size 9.9 MB
Tags CPython 3.12 Linux glibc 2.39+ x86-64 abi3
SHA-256 checksum
How to use checksums
95e6f687f60a05f3f42e83d9d22a3c4dff7518b756b98a9f93fbccc09f842c98
BLAKE2b-256 checksum
How to use checksums
9d7638e594bb71b481107f9109bb16d2059b0dd6fe8abb3dbe317e6f4476f810
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / mcp_methods-0.6.3-cp312-abi3-macosx_11_0_arm64.whl

Download URL mcp_methods-0.6.3-cp312-abi3-macosx_11_0_arm64.whl
Size 8.9 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c473001563773c50b426dc377a541ca76e04e08d3a2bf95f4d2000df3ed0a90f
BLAKE2b-256 checksum
How to use checksums
a483b28595b6ebf5fadaee41601a5dfb34252a63e9c2a71b86dd6efacda58c49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for mcp-methods 0.6.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.6.3 This release

3 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page