Expand description
§Alou - 智能自动化工作流系统
一个基于Rust和Model Context Protocol (MCP)的智能自动化工作流系统,集成了DeepSeek API, 提供强大的上下文感知和工具调用能力。
这个库提供了完整的MCP协议实现,支持AI模型与其运行环境之间的通信。 支持客户端和服务器实现,通过stdio传输层进行通信。
项目地址: https://github.com/your-username/alou-rust
§Features
- Full implementation of MCP protocol specification
- Stdio transport layer
- Async/await support using Tokio
- Type-safe message handling
- Comprehensive error handling
§Example
use std::sync::Arc;
use mcp_client_rs::client::Client;
use mcp_client_rs::transport::stdio::StdioTransport;
use tokio::io::{stdin, stdout};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a Stdio transport using standard input/output
let transport = StdioTransport::with_streams(stdin(), stdout())?;
// Create the client with Arc-wrapped transport
let client = Client::new(Arc::new(transport));
// Use the client...
Ok(())
}§Usage
The client can be used to send requests and notifications to an MCP-compliant server. See the client module for details on initialization and tool usage.
Re-exports§
pub use error::Error;pub use protocol::Notification;pub use protocol::Request;pub use protocol::Response;pub use types::*;
Modules§
- agent
- Agent module provides the intelligent agent implementation
- api
- API endpoints
- auth
- Authentication logic (JWT, OAuth, middleware)
- client
- Client module provides the MCP client implementation
- connection_
pool - Connection pool for managing multiple MCP connections
- db
- Database connection and management
- error
- Error types and handling for the SDK Error types for the MCP protocol.
- models
- Data models for users and sessions
- prompt_
registry - Prompt registry for managing MCP prompts
- prompts
- System prompts and templates
- protocol
- Protocol-specific types and implementations
- server
- Server module provides the MCP server implementation
- transport
- Transport layer implementations (stdio)
- types
- Common types used throughout the SDK
- workspace_
context - Workspace context for managing project directories
Constants§
- JSONRPC_
VERSION - JSON-RPC version used by the MCP protocol
- LATEST_
PROTOCOL_ VERSION - The latest supported protocol version of MCP
- SUPPORTED_
PROTOCOL_ VERSIONS - List of all protocol versions supported by this SDK