mcpkit-core

Crates.iomcpkit-core
lib.rsmcpkit-core
version0.5.0
created_at2025-12-11 17:01:26.743221+00
updated_at2025-12-26 00:52:16.928183+00
descriptionCore types and traits for the Model Context Protocol (MCP)
homepage
repositoryhttps://github.com/praxiomlabs/mcpkit
max_upload_size
id1980136
size452,937
Justin (jkindrix)

documentation

README

mcpkit-core

Core types and traits for the Model Context Protocol (MCP).

This crate provides the foundational building blocks for the MCP SDK:

  • Protocol types: JSON-RPC 2.0 request/response/notification types
  • MCP types: Tools, resources, prompts, tasks, content, sampling, elicitation
  • Capability negotiation: Client and server capabilities
  • Error handling: Unified McpError type with rich diagnostics
  • Typestate connection: Compile-time enforced connection lifecycle
  • OAuth 2.1 / PKCE: Authentication primitives

Runtime Agnostic

This crate does not depend on any async runtime. It can be used with Tokio, smol, or any other executor.

Protocol Version

Implements MCP protocol version 2025-11-25 with backward compatibility for 2024-11-05.

Usage

use mcpkit_core::{
    types::{Tool, ToolOutput, Content},
    capability::{ServerCapabilities, ServerInfo},
};

// Create a tool definition
let tool = Tool::new("search")
    .description("Search the database")
    .input_schema(serde_json::json!({
        "type": "object",
        "properties": {
            "query": { "type": "string" }
        },
        "required": ["query"]
    }));

// Create server capabilities
let caps = ServerCapabilities::new()
    .with_tools()
    .with_resources()
    .with_tasks();

// Create server info
let info = ServerInfo::new("my-server", "1.0.0");

Feature Flags

  • fancy-errors - Enable miette's fancy error reporting with terminal colors

Part of mcpkit

This crate is part of the mcpkit SDK. For most use cases, depend on mcpkit directly rather than this crate.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Commit count: 0

cargo fmt