spec_kit_mcp/lib.rs
1//! Spec-Kit MCP Server
2//!
3//! MCP server that enables AI coding assistants to use spec-driven development practices
4//! via the GitHub Spec-Kit toolkit.
5//!
6//! # Features
7//!
8//! - **9 Spec-Kit Tools**: Complete workflow from constitution to implementation
9//! - **MCP Protocol**: Full JSON-RPC 2.0 implementation
10//! - **Async/Await**: Built on Tokio for high performance
11//! - **Type Safety**: Comprehensive type system with validation
12//! - **Error Handling**: Helpful error messages for debugging
13//!
14//! # Quick Start
15//!
16//! ## As a Binary
17//!
18//! ```bash
19//! # Via cargo
20//! cargo install spec-kit-mcp
21//! spec-kit-mcp
22//!
23//! # Via npx
24//! npx @speckit/mcp
25//! ```
26//!
27//! ## Configure in Claude Code
28//!
29//! Add to `.mcp.json`:
30//!
31//! ```json
32//! {
33//! "mcpServers": {
34//! "spec-kit": {
35//! "command": "npx",
36//! "args": ["@speckit/mcp@latest"]
37//! }
38//! }
39//! }
40//! ```
41//!
42//! # Architecture
43//!
44//! ```text
45//! AI Agent → MCP Protocol → Tool Registry → Spec-Kit CLI → File System
46//! ```
47//!
48//! # Available Tools
49//!
50//! 1. `speckit_init` - Initialize a new spec-kit project
51//! 2. `speckit_constitution` - Create governing principles
52//! 3. `speckit_specify` - Define requirements and user stories
53//! 4. `speckit_plan` - Create technical implementation plan
54//! 5. `speckit_tasks` - Generate actionable task list
55//! 6. `speckit_implement` - Execute implementation
56//! 7. `speckit_clarify` - Clarify ambiguous requirements
57//! 8. `speckit_analyze` - Analyze cross-artifact consistency
58//! 9. `speckit_checklist` - Generate validation checklist
59//!
60//! # Example Usage
61//!
62//! ```rust,no_run
63//! use spec_kit_mcp::{McpServer, create_registry, SpecKitCli};
64//!
65//! #[tokio::main]
66//! async fn main() -> anyhow::Result<()> {
67//! // Create CLI interface
68//! let cli = SpecKitCli::new();
69//!
70//! // Create tool registry
71//! let registry = create_registry(cli);
72//!
73//! // Create and run server
74//! let mut server = McpServer::new(registry);
75//! server.run().await?;
76//!
77//! Ok(())
78//! }
79//! ```
80
81pub mod config;
82pub mod mcp;
83pub mod speckit;
84pub mod tools;
85pub mod utils;
86
87// Re-export main types
88pub use mcp::{McpServer, ProtocolHandler, StdioTransport};
89pub use speckit::{SpecKitCli, SpecKitError};
90pub use tools::{create_registry, Tool, ToolRegistry};