Crate mcp_tools

Source
Expand description

§MCP Tools - Unified MCP Tools Crate

A comprehensive collection of MCP (Model Context Protocol) servers and clients built on top of the powerful CoderLib library. This crate provides standalone MCP servers that can be used with any MCP-compatible client (Claude Desktop, etc.) and clients for testing and development.

§Features

§MCP Servers

  • File Operations Server - File system operations with security
  • Git Tools Server - Git repository management and analysis
  • Code Analysis Server - Language-aware code analysis and refactoring
  • Web Tools Server - Web scraping and HTTP operations
  • System Tools Server - System information and process management

§MCP Clients

  • CLI Client - Command-line MCP client for testing
  • Desktop Client - GUI client for interactive use

§Quick Start

§Running a File Operations Server

cargo run --bin mcp-file-server -- --port 3000

§Using the CLI Client

cargo run --bin mcp-cli -- connect ws://localhost:3000

§Architecture

┌─────────────────────────────────────────────────────────────┐
│                    MCP Tools Crate                         │
├─────────────────────────────────────────────────────────────┤
│  Servers          │  Clients         │  Examples           │
│  ├─ file-ops      │  ├─ cli          │  ├─ basic-client    │
│  ├─ git-tools     │  ├─ desktop      │  ├─ advanced-server │
│  ├─ code-analysis │  └─ ...          │  └─ ...             │
│  ├─ web-tools     │                  │                     │
│  └─ system-tools  │                  │                     │
├─────────────────────────────────────────────────────────────┤
│                      CoderLib                               │
│  ┌─ Core ─┐ ┌─ Tools ─┐ ┌─ MCP ─┐ ┌─ Permission ─┐        │
│  │ Session│ │ File   │ │ SDK  │ │ Security     │        │
│  │ LLM    │ │ Git    │ │ Proto│ │ Validation   │        │
│  │ Storage│ │ Code   │ │ Tools│ │ Session Mgmt │        │
│  └────────┘ └────────┘ └──────┘ └──────────────┘        │
└─────────────────────────────────────────────────────────────┘

Re-exports§

pub use common::*;

Modules§

clients
MCP Client implementations
common
Common types and utilities shared across MCP Tools
config
Configuration management for MCP Tools
servers
MCP Server implementations
utils
Utility functions for MCP Tools

Structs§

Annotated
Annotations
ArgumentInfo
CallToolRequestMethod
CallToolRequestParam
CallToolResult
CancelledNotificationMethod
CancelledNotificationParam
ClientCapabilitiesBuilder
ClientCapabilitiesBuilderState
CompleteRequestMethod
CompleteRequestParam
CompleteResult
CompletionInfo
CreateMessageRequestMethod
CreateMessageRequestParam
CreateMessageResult
EmptyObject
ErrorCode
ErrorData
Error information for JSON-RPC error responses.
GetPromptRequestMethod
GetPromptRequestParam
GetPromptResult
Implementation
InitializeRequestParam
InitializeResult
InitializeResultMethod
InitializedNotificationMethod
JsonContent
JsonRpcError
JsonRpcNotification
JsonRpcRequest
JsonRpcResponse
JsonRpcVersion2_0
ListPromptsRequestMethod
ListPromptsResult
ListResourceTemplatesRequestMethod
ListResourceTemplatesResult
ListResourcesRequestMethod
ListResourcesResult
ListRootsRequestMethod
ListRootsResult
ListToolsRequestMethod
ListToolsResult
LoggingMessageNotificationMethod
LoggingMessageNotificationParam
McpToolsInfo
Information about MCP Tools
ModelHint
ModelPreferences
Notification
NotificationNoParam
PaginatedRequestParamInner
PingRequestMethod
ProgressNotificationMethod
ProgressNotificationParam
Prompt
A prompt that can be used to generate text from a model
PromptArgument
Represents a prompt argument that can be passed to customize the prompt
PromptArgumentTemplate
A template for a prompt argument, this should be identical to PromptArgument
PromptListChangedNotificationMethod
PromptMessage
A message in a prompt conversation
PromptReference
PromptTemplate
A template for a prompt
PromptsCapability
ProtocolVersion
RawEmbeddedResource
RawImageContent
RawResource
Represents a resource in the extension with metadata
RawResourceTemplate
RawTextContent
ReadResourceRequestMethod
ReadResourceRequestParam
ReadResourceResult
Request
RequestMeta
RequestNoParam
ResourceListChangedNotificationMethod
ResourceReference
ResourceUpdatedNotificationMethod
ResourceUpdatedNotificationParam
ResourcesCapability
Root
RootsCapabilities
RootsListChangedNotificationMethod
SamplingMessage
ServerCapabilitiesBuilder
ServerCapabilitiesBuilderState
SetLevelRequestMethod
SetLevelRequestParam
SubscribeRequestMethod
SubscribeRequestParam
Tool
A tool that can be used by a model.
ToolListChangedNotificationMethod
ToolsCapability
UnsubscribeRequestMethod
UnsubscribeRequestParam
WithMeta

Enums§

ClientNotification
ClientRequest
ClientResult
JsonRpcMessage
LoggingLevel
McpToolsError
Error types for MCP Tools
Message
NumberOrString
PromptMessageContent
Content types that can be included in prompt messages
PromptMessageRole
Represents the role of a message sender in a prompt conversation
RawContent
Reference
ResourceContents
Role
ServerNotification
ServerRequest
ServerResult

Constants§

DEFAULT_HOST
Default MCP server configuration
DEFAULT_PORT
VERSION
MCP Tools version

Traits§

AnnotateAble
ConstString
IntoContents
Types that can be converted into a list of contents

Functions§

info
Get MCP Tools information
init_logging
Initialize logging for MCP Tools
object
unwrap the JsonObject under serde_json::Value

Type Aliases§

CancelledNotification
Cancellation
ClientJsonRpcMessage
ClientMessage
CompleteRequest
Content
CreateMessageRequest
Cursor
EmbeddedResource
EmptyResult
Empty result
ExperimentalCapabilities
GetPromptRequest
ImageContent
InitializedNotification
This notification is sent from the client to the server after initialization has finished.
JsonObject
ListPromptsRequest
ListResourceTemplatesRequest
ListResourcesRequest
ListRootsRequest
ListToolsRequest
LoggingMessageNotification
McpError
PaginatedRequestParam
PingRequest
ProgressNotification
ProgressToken
PromptListChangedNotification
ReadResourceRequest
RequestId
Resource
ResourceListChangedNotification
ResourceTemplate
ResourceUpdatedNotification
Result
Result type for MCP Tools operations
RootsListChangedNotification
ServerJsonRpcMessage
ServerMessage
SetLevelRequest
SubscribeRequest
TextContent
ToolListChangedNotification
UnsubscribeRequest