{"id":31486674,"url":"https://github.com/eyalzh/context-kit","last_synced_at":"2025-10-02T11:57:30.171Z","repository":{"id":314319726,"uuid":"1032463064","full_name":"eyalzh/context-kit","owner":"eyalzh","description":"A CLI tool and MCP client, used to create spec files for AI coding agents with context baked in","archived":false,"fork":false,"pushed_at":"2025-09-26T11:27:44.000Z","size":1938,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-26T13:13:36.832Z","etag":null,"topics":["cli-tool","mcp-client","spec-generator"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eyalzh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-05T10:44:32.000Z","updated_at":"2025-09-26T11:27:48.000Z","dependencies_parsed_at":"2025-09-11T21:12:43.323Z","dependency_job_id":"bb9e12ec-1ada-429c-850d-92b098c5617c","html_url":"https://github.com/eyalzh/context-kit","commit_stats":null,"previous_names":["eyalzh/context-kit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eyalzh/context-kit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalzh%2Fcontext-kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalzh%2Fcontext-kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalzh%2Fcontext-kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalzh%2Fcontext-kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyalzh","download_url":"https://codeload.github.com/eyalzh/context-kit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyalzh%2Fcontext-kit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278001460,"owners_count":25913080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-02T02:00:08.890Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-tool","mcp-client","spec-generator"],"created_at":"2025-10-02T11:57:26.873Z","updated_at":"2025-10-02T11:57:30.164Z","avatar_url":"https://github.com/eyalzh.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# ContextKit\n\nA CLI tool and MCP client for creating spec files for AI coding agents. ContextKit generates specs from reusable Jinja2-based templates, filling in context from various MCP sources and user input.\n\n**Note**: While ContextKit is an MCP client, it doesn't use an AI model - it's a tool to harness the MCP ecosystem for context injection.\n\n\u003cdetails\u003e\n\u003csummary\u003eDemo\u003c/summary\u003e\n\n![](./docs/usecase1.gif)\n\n\u003c/details\u003e\n\n## How it Works 🚀\n\nContextKit utilizes the MCP (Model Context Protocol) ecosystem to inject context into spec files from various sources like ticketing systems, databases, document storage, and design tools. It works with spec templates - reusable Jinja2 template files containing context variables that define the common structure and requirements of development tasks.\n\nContext variables are automatically fetched from MCP resources when possible, or collected interactively from the user when additional input is needed.\n\n## Installation 📦\n\n### Requirements\n- Python 3.11 or higher\n\n### Install from source\n\n```bash\ngit clone \u003crepository-url\u003e\ncd context-kit\nuv sync\n```\n\n### Install in editable mode\n\n```bash\npip3 install -e .\n```\n\nAfter editable installation, you can use the `cxk` command directly:\n```bash\ncxk --help\n```\n\nAlternatively, without editable installation:\n```bash\npython cxk.py --help\n# or with uv:\nuv run cxk.py --help\n```\n\n## Quick Start 🏃\n\n### 1. Initialize a project\nRun this in your project directory. It creates a `.cxk/` directory to store config.\n```bash\ncxk init\n```\n\n### 2. Add MCP servers\n```bash\n# Add SSE server\ncxk mcp add-sse ticket-server http://localhost:3000\n\n# Add stdio server with environment\ncxk mcp add-stdio local-tools --env API_KEY=secret -- python server.py\n\n# Add HTTP server\ncxk mcp add-http doc-service http://localhost:8000\n```\n\n### 3. Create a spec from template\n```bash\ncxk create-spec path/to/template.md\n```\n\n## Usage Examples 💻\n\n### Basic Template with a variable\n\n**Template (spec.md):**\n```markdown\n# Development Task\nPlease develop the task below. You should start by ...\n\n## PRD\n{{ prd }}\n```\n\n**Generate spec:**\n```bash\ncxk create-spec spec.md\n```\n\nThis will prompt you to provide a value for `prd` either directly or by selecting an MCP tool to call.\n\n### Basic Template with MCP Tool Call\n\n**Template (spec.md):**\n```markdown\n# Development Task\nPlease develop the task below. You should start by ...\n\n{% set ticket = call_tool('ticket-service', 'get_issue', {'cloudId': '1234', 'issueKey': ticket_id}) %}\n\n## Task Description\n{{ ticket.fields.description }}\n\n## Acceptance Criteria\n{{ ticket.fields.acceptance_criteria }}\n```\n\n**Generate spec:**\n```bash\ncxk create-spec spec.md --var ticket_id=ACME-123\n```\n\n### Template with MCP Resource\n\n**Template (design-spec.md):**\n```markdown\n## Design Requirements\n{{ get_resource('figma-service', 'designs://'+design_id) }}\n```\n\n**Generate spec:**\n```bash\ncxk create-spec design-spec.md --var design_id=fig-456\n```\n\n### Advanced: Filtering and Processing Context\n\n**Filter sensitive information:**\n```markdown\n{% set support_ticket = call_tool('support', 'getTicket', ticket_id) %}\n## Support Request\n{{ support_ticket | regex_replace(r'\\b[\\w.+-]+@[\\w.-]+\\.\\w+\\b', '[EMAIL_REDACTED]') }}\n```\n\n**Extract specific fields:**\n```markdown\n{% set ticket = call_tool('ticket-service', 'get_issue', {'issueKey': ticket_id}) %}\n## Summary\n{{ ticket.fields.summary }}\n\n## Priority\n{{ ticket.fields.priority.name }}\n```\n\n### Interactive Variable Collection\n\nWhen variables aren't provided via `--var`, ContextKit prompts interactively:\n\n```bash\ncxk create-spec template.md\n# Prompts:\n# ? How would you like to provide the value for 'ticket_id'?\n#   › Provide value directly\n#     Use MCP tool to fetch value\n#     Read from file\n```\n\n### Output to File\n\n```bash\ncxk create-spec template.md --output result.md --var ticket_id=ACME-123\n```\n\n### Pipe Template Content\n\n```bash\ncat template.md | cxk create-spec --var ticket_id=ACME-123\n```\n\n## CLI Commands 🛠️\n\n### Project Management\n\n```bash\n# Initialize new project (creates .cxk/ directory)\ncxk init\n```\n\n### MCP Server Management\n\n```bash\n# Add SSE MCP server\ncxk mcp add-sse \u003cserver-name\u003e \u003cwebsocket-url\u003e\n\n# Add stdio MCP server\ncxk mcp add-stdio \u003cserver-name\u003e [--env KEY=value] -- \u003ccommand\u003e [args...]\n\n# Add HTTP MCP server  \ncxk mcp add-http \u003cserver-name\u003e \u003chttp-url\u003e [--header KEY=value]\n```\n\n### Spec Generation\n\n```bash\n# Generate spec from template\ncxk create-spec \u003ctemplate-path\u003e [--var KEY=value] [--output \u003cfile\u003e]\n\n# Generate with multiple variables\ncxk create-spec template.md --var ticket_id=ACME-123 --var env=production\n```\n\n## Template Language 📝\n\nContextKit uses **Jinja2** as its template engine with additional global functions:\n\n### Available Functions\n\n- `call_tool(server_name, tool_name, arguments)` - Call MCP tool\n- `get_resource(server_name, resource_uri)` - Get MCP resource\n- All standard Jinja2 filters and functions\n\n### Template Variables\n\nVariables can be:\n- **Direct values**: `--var ticket_id=ACME-123`\n- **JSON objects**: `--var ticket='{\"id\": 123, \"status\": \"open\"}'`\n- **Interactive input**: Prompted when not provided\n\n## Configuration 📋\n\n\n### MCP Configuration Examples\n\n```bash\n# Development setup\ncxk init\ncxk mcp add-sse jira https://mcp.example.com/jira\ncxk mcp add-stdio local-db --env DB_URL=postgresql://... -- python db_server.py\ncxk mcp add-http docs http://localhost:8000 --header Authorization='Bearer token'\n```\n\n## Why ContextKit? 🤔\n\n### Benefits\n- **🚀 Speed**: Pre-populate specs with relevant context automatically\n- **💰 Cost reduction**: AI agents don't need to make additional MCP calls\n- **🧹 Clean codebase**: Keep reusable spec templates in version control\n- **🔄 Consistency**: Standardized spec format across your team\n- **🔌 Extensible**: Leverage the growing MCP ecosystem\n\n\n## Development 🔨\n\n```bash\n# Install development dependencies\nuv sync\n\n# Run tests\nuv run pytest\n\n# Run linting\nuv run ruff check\nuv run ruff format\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyalzh%2Fcontext-kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyalzh%2Fcontext-kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyalzh%2Fcontext-kit/lists"}