Skip to content

ACNet-AI/mcp-spec-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

49 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

mcp-speckit

Tests Coverage Python License

AI Agent lifecycle management toolkit for MCP Server Lifecycle Specification

mcp-speckit is a specification-driven toolkit that guides AI agents through the complete lifecycle of MCP (Model Context Protocol) server development, from requirements gathering to deployment and operations.

🎯 Purpose

  • Spec-Driven: Enforces compliance with MCP Server Lifecycle Specification v1.0.0
  • AI-First: Designed for AI agent workflows with Slash Commands
  • Complete Lifecycle: Covers UNDERSTAND β†’ DESIGN β†’ BUILD β†’ TEST β†’ DEPLOY β†’ OPERATE phases
  • Validation Engine: Two-stage validation (JSON Schema + specification rules)

πŸš€ Quick Start

Installation

pip install mcp-speckit

Initialize a New Project

mcp-speckit init my-mcp-server
cd my-mcp-server

This creates:

my-mcp-server/
β”œβ”€β”€ artifacts/              # Specification artifacts
β”‚   └── requirements_document.json
β”œβ”€β”€ tools/                  # Tool implementations
β”œβ”€β”€ resources/              # Resource implementations
β”œβ”€β”€ prompts/                # Prompt implementations
└── README.md

Validate Artifacts

# Check entire project
mcp-speckit check

# Check specific file
mcp-speckit check artifacts/requirements_document.json

# Strict mode (warnings as errors)
mcp-speckit check --strict

# JSON output
mcp-speckit check --json > results.json

πŸ“š CLI Commands

init - Initialize Project

Create a new MCP server project with templates.

mcp-speckit init <path> [OPTIONS]

Options:

  • --template, -t: Server type (stdio or sse, default: stdio)
  • --force, -f: Overwrite existing directory

Examples:

mcp-speckit init my-server
mcp-speckit init my-server --template sse
mcp-speckit init my-server --force

check - Validate Artifacts

Validate artifacts against MCP Server Lifecycle Specification.

mcp-speckit check [PATH] [OPTIONS]

Options:

  • --type, -t: Explicit artifact type (requirements_document, technical_design_specification)
  • --strict, -s: Treat warnings as errors
  • --json: Output results as JSON

Examples:

mcp-speckit check                                    # Current directory
mcp-speckit check artifacts/requirements.json        # Single file
mcp-speckit check --type requirements_document req.json
mcp-speckit check --strict                           # Strict validation

Exit Codes:

  • 0: All artifacts valid
  • 1: Validation errors found
  • 2: File/directory not found or other error

πŸ€– AI Agent Interface (Slash Commands)

mcp-speckit provides Slash Commands for AI-guided development:

Lifecycle Phase Commands

  • /mcpspeckit.understand - Requirements gathering and analysis
  • /mcpspeckit.design - Technical design specification
  • /mcpspeckit.build - Implementation guidance
  • /mcpspeckit.test - Testing and validation
  • /mcpspeckit.deploy - Deployment orchestration
  • /mcpspeckit.operate - Runtime management

Support Commands

  • /mcpspeckit.get-spec - Specification specification reference
  • /mcpspeckit.validate-requirements - Validate requirements document
  • /mcpspeckit.validate-design - Validate design specification

Location: templates/mcp-spec/commands/

πŸ“‹ Specification Compliance

Supported Artifacts

1. Requirements Document

{
  "mcp_spec_version": "1.0.0",
  "spec_version": "1.0.0",
  "project_name": "my-server",
  "description": "Server description",
  "server_type": "stdio",
  "functional_requirements": [
    {
      "id": "FR-001",
      "description": "Requirement description",
      "priority": "high",
      "acceptance_criteria": ["Criterion 1"]
    }
  ],
  "non_functional_requirements": []
}

2. Technical Design Specification

{
  "mcp_spec_version": "1.0.0",
  "spec_version": "1.0.0",
  "project_name": "my-server",
  "description": "Design description",
  "server_type": "stdio",
  "architecture": {
    "overview": "Architecture overview",
    "components": []
  },
  "tools": [],
  "prompts": [],
  "resources": []
}

Validation Rules

Schema Validation:

  • Required fields presence
  • Field types and formats
  • Enum values (priority, server_type)
  • String length constraints
  • Array length constraints

Specification Rules:

  • MCP version format (1.x.x)
  • At least one high-priority requirement (warning)
  • Tool/prompt/resource naming conventions

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  CLI Layer (init + check)               β”‚
β”‚  β€’ User interaction                     β”‚
β”‚  β€’ Rich formatted output                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Validator Core                          β”‚
β”‚  β€’ JSON Schema validation               β”‚
β”‚  β€’ Specification rules checking              β”‚
β”‚  β€’ Error message generation             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Utils Layer                             β”‚
β”‚  β€’ File loading (JSON/YAML)             β”‚
β”‚  β€’ Artifact type detection              β”‚
β”‚  β€’ Project structure creation           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Models + Schemas                        β”‚
β”‚  β€’ Pydantic models                      β”‚
β”‚  β€’ JSON Schema definitions              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ§ͺ Testing

# Run all tests
pytest tests/

# Run with coverage
pytest tests/ --cov=src/mcp_speckit --cov-report=html

# Run specific test suite
pytest tests/unit/test_validator.py -v
pytest tests/integration/test_cli.py -v

Test Coverage: 95%

  • models.py: 97%
  • schemas/: 100%
  • validator.py: 94%
  • utils.py: 100%
  • cli.py: 88%

🌐 MCP Factory Ecosystem

mcp-speckit is part of the MCP Factory ecosystem:

πŸ“– Documentation

🀝 Contributing

This project follows the MetaSpec specification-driven development methodology:

  1. Specifications First: All changes start with specification updates
  2. AI-Assisted: Use Slash Commands for guided development
  3. Quality Standards: Defined in memory/constitution.md

πŸ“„ License

MIT License - see LICENSE for details

πŸ”— Links


Generated with: MetaSpec 0.2.0
Specification Version: MCP Server Lifecycle Specification v1.0.0

About

Spec-driven lifecycle management toolkit for MCP server development with AI agents.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published