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.10 through 3.13 without reinstall.

Rust library — cargo add

[dependencies]
mcp-methods = "0.4"
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. The 0.4 line 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 (three-layer: project → domain pack → 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.4.8

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.4.8
File Interpreter ABI Platform
mcp_methods-0.4.8-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
mcp_methods-0.4.8-cp310-abi3-manylinux_2_39_x86_64.whl CPython 3.10 abi3 Linux glibc 2.39+ x86-64 Details
mcp_methods-0.4.8-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 23.9 MB

Release files / mcp_methods-0.4.8-cp310-abi3-win_amd64.whl

Download URL mcp_methods-0.4.8-cp310-abi3-win_amd64.whl
Size 7.5 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
78e52f46954a2f75cd02996c466f0b33c849508a39833094397cdcdb71637972
BLAKE2b-256 checksum
How to use checksums
d325f099ee1cba4beb8d92640e6d0e38de695e138e0c0080967000e2639d37c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / mcp_methods-0.4.8-cp310-abi3-manylinux_2_39_x86_64.whl

Download URL mcp_methods-0.4.8-cp310-abi3-manylinux_2_39_x86_64.whl
Size 8.7 MB
Tags CPython 3.10 Linux glibc 2.39+ x86-64 abi3
SHA-256 checksum
How to use checksums
756e836ed284362d1d6b029114fe946da388b0047259099a6e48563194508c0d
BLAKE2b-256 checksum
How to use checksums
bbae5a95f1bfcfc082bc2e1216cbfa2927c8cf75a6a3ac9b6c4d9a11a7c57fe2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / mcp_methods-0.4.8-cp310-abi3-macosx_11_0_arm64.whl

Download URL mcp_methods-0.4.8-cp310-abi3-macosx_11_0_arm64.whl
Size 7.7 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f40b7e3a640939c1745e9f710ce1e72b09a1d35407742230684d15eb15fc11df
BLAKE2b-256 checksum
How to use checksums
23256363f0351b1269024c43e9b0cebfead498d50a6e7f8e2016274b673d036c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.4.13

3 release files

0.4.12

3 release files

0.4.11

3 release files

0.4.10

3 release files

0.4.9

3 release files

This release

0.4.8 This release

3 release files

0.4.7

3 release files

0.4.6

3 release files

0.4.5

3 release files

0.4.4

3 release files

0.4.3

3 release files

0.4.2

3 release files

0.4.1

3 release files

0.4.0

3 release files

0.3.44

3 release files

0.3.43

3 release files

0.3.42

3 release files

0.3.40

3 release files

0.3.39

3 release files

0.3.38

3 release files

0.3.37

3 release files

0.3.36

3 release files

0.3.35

3 release files

0.3.34

3 release files

0.3.33

3 release files

0.3.32

3 release files

0.3.31

3 release files

0.3.30

3 release files

0.3.29

3 release files

0.3.28

3 release files

0.3.27

3 release files

0.3.26

3 release files

0.3.9

12 release files

0.3.8

12 release files

0.3.7

12 release files

0.3.6

12 release files

0.3.5

12 release files

0.3.4

12 release files

0.3.3

12 release files

0.3.2

12 release files

0.3.1

12 release files

0.2.9

12 release files

0.2.8

12 release files

0.2.7

12 release files

0.2.5

12 release files

0.1.1

2 release files

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