|
1 | 1 | # DevsContext |
2 | 2 |
|
3 | | -**Synthesized engineering context for AI coding agents.** |
| 3 | +MCP server that gives AI coding agents synthesized engineering context — requirements, decisions, architecture, and standards — from your actual tools. |
4 | 4 |
|
5 | | -DevsContext is an open-source MCP server that gives AI coding tools (Claude Code, |
6 | | -Cursor, etc.) the full picture when working on a task — requirements, team decisions, |
7 | | -architecture patterns, and coding standards — all in one synthesized context block. |
| 5 | +## The Problem |
8 | 6 |
|
9 | | -> Large tech companies build this internally. DevsContext brings it to everyone. |
| 7 | +AI coding agents lack context. They don't know your team's decisions, architecture patterns, or coding standards. Connecting raw MCP servers floods them with irrelevant data they can't prioritize. Large companies build internal context infrastructure. DevsContext brings that to everyone. |
10 | 8 |
|
11 | | -## The Problem |
| 9 | +## What You Get |
| 10 | + |
| 11 | +When you say "work on PROJ-123" in Claude Code, DevsContext fetches from Jira, meeting transcripts, and your docs, then synthesizes it into this: |
| 12 | + |
| 13 | +```markdown |
| 14 | +## Task: PROJ-123 — Add retry logic to payment webhook handler |
| 15 | + |
| 16 | +### Requirements |
| 17 | +1. Implement exponential backoff for failed webhook deliveries |
| 18 | +2. Max 5 retry attempts over 24 hours |
| 19 | +3. Dead-letter queue for permanently failed webhooks |
| 20 | +4. Metrics for retry success/failure rates |
| 21 | + |
| 22 | +Acceptance criteria: [Jira PROJ-123] |
| 23 | +- [ ] Webhooks retry with exponential backoff (1min, 5min, 30min, 2hr, 12hr) |
| 24 | +- [ ] Failed webhooks move to DLQ after 5 attempts |
| 25 | +- [ ] Dashboard shows retry metrics |
| 26 | + |
| 27 | +### Key Decisions |
| 28 | +- **Use SQS with visibility timeout** for retry scheduling, not cron jobs. |
| 29 | + Decided by @sarah in March 15 sprint planning. Rationale: SQS handles |
| 30 | + timing natively, reduces operational overhead. [Meeting: Sprint 23 Planning] |
12 | 31 |
|
13 | | -AI coding agents are smart but lack context. They don't know: |
14 | | -- Why a feature was decided on (from your sprint planning meeting) |
15 | | -- How your team structures code (from your architecture docs) |
16 | | -- What coding patterns to follow (from your style guides) |
| 32 | +- **Exponential backoff schedule**: 1min → 5min → 30min → 2hr → 12hr. |
| 33 | + Based on payment processor rate limits. [Comment by @mike, Mar 16] |
17 | 34 |
|
18 | | -Connecting individual MCP servers (Jira, Confluence, etc.) helps, but the AI |
19 | | -gets flooded with raw data and picks up irrelevant context. |
| 35 | +### Architecture Context |
| 36 | +Webhook flow: `PaymentController` → `WebhookService.dispatch()` → SQS queue |
| 37 | +→ `WebhookWorker.process()` → external endpoint. |
20 | 38 |
|
21 | | -## The Solution |
| 39 | +Add retry logic in `WebhookWorker.process()` at: |
| 40 | +`src/workers/webhook_worker.ts:45-80` |
22 | 41 |
|
23 | | -DevsContext fetches from your tools, extracts what's relevant, and synthesizes |
24 | | -it into a clean context block — so your AI agent knows *what* to build, *why* |
25 | | -it was decided, and *how* it should be written. |
| 42 | +DLQ table schema in `migrations/004_webhook_dlq.sql`. [Architecture: payments-service.md] |
| 43 | + |
| 44 | +### Coding Standards |
| 45 | +- Use `Result<T, WebhookError>` pattern, don't throw exceptions |
| 46 | +- Retry delays: use `calculateBackoff(attempt)` helper from `src/utils/retry.ts` |
| 47 | +- Tests: mock SQS with `@aws-sdk/client-sqs-mock`, see `tests/workers/` for examples |
| 48 | +[Standards: typescript.md, testing.md] |
| 49 | + |
| 50 | +### Related Work |
| 51 | +- PROJ-456: "Payment webhook initial implementation" (Done) — base implementation |
| 52 | +- PROJ-789: "Add webhook monitoring dashboard" (In Progress) — will consume the metrics |
| 53 | +``` |
| 54 | + |
| 55 | +One synthesized block. Everything the AI needs to write correct code. |
26 | 56 |
|
27 | 57 | ## Quick Start |
28 | 58 |
|
29 | 59 | ```bash |
30 | 60 | pip install devscontext |
31 | 61 | devscontext init |
| 62 | +``` |
| 63 | + |
| 64 | +Set your credentials: |
| 65 | +```bash |
| 66 | +export JIRA_EMAIL="you@company.com" |
| 67 | +export JIRA_API_TOKEN="your-token" |
| 68 | +export ANTHROPIC_API_KEY="your-key" # for synthesis |
| 69 | +``` |
| 70 | + |
| 71 | +Connect to Claude Code: |
| 72 | +```bash |
32 | 73 | claude mcp add devscontext -- devscontext serve |
33 | 74 | ``` |
34 | 75 |
|
35 | 76 | Then in Claude Code: |
36 | | - |
37 | 77 | ``` |
38 | | -work on PROJ-1234 |
| 78 | +> work on PROJ-123 |
39 | 79 | ``` |
40 | 80 |
|
41 | | -Claude automatically gets the full context. |
| 81 | +## Supported Sources |
| 82 | + |
| 83 | +| Source | What's Fetched | |
| 84 | +|--------|----------------| |
| 85 | +| **Jira** | Ticket details, comments, linked issues, acceptance criteria | |
| 86 | +| **Fireflies** | Meeting transcripts, decisions, action items | |
| 87 | +| **Local Docs** | Architecture docs, coding standards, ADRs | |
| 88 | + |
| 89 | +Coming soon: Linear, Notion, Confluence, Slack threads |
42 | 90 |
|
43 | 91 | ## Configuration |
44 | 92 |
|
45 | | -Create a `.devscontext.yaml` file in your project root: |
| 93 | +DevsContext uses `.devscontext.yaml` in your project root: |
46 | 94 |
|
47 | 95 | ```yaml |
48 | 96 | adapters: |
49 | 97 | jira: |
50 | 98 | enabled: true |
51 | 99 | base_url: "https://your-company.atlassian.net" |
52 | | - email: "your-email@company.com" |
| 100 | + email: "${JIRA_EMAIL}" |
53 | 101 | api_token: "${JIRA_API_TOKEN}" |
54 | 102 |
|
55 | 103 | fireflies: |
56 | | - enabled: false |
| 104 | + enabled: false # Optional |
57 | 105 | api_key: "${FIREFLIES_API_KEY}" |
58 | 106 |
|
59 | 107 | local_docs: |
60 | 108 | enabled: true |
61 | 109 | paths: |
62 | 110 | - "./docs" |
| 111 | + - "./CLAUDE.md" |
63 | 112 |
|
64 | | -cache: |
65 | | - ttl_seconds: 300 |
66 | | - max_size: 100 |
| 113 | +synthesis: |
| 114 | + provider: "anthropic" |
| 115 | + model: "claude-3-haiku-20240307" |
67 | 116 | ``` |
68 | 117 |
|
69 | | -## Available Tools |
| 118 | +See [.devscontext.yaml.example](.devscontext.yaml.example) for all options. |
70 | 119 |
|
71 | | -| Tool | Description | |
72 | | -|------|-------------| |
73 | | -| `get_task_context` | Full synthesized context for a Jira ticket | |
74 | | -| `search_context` | Search across all sources by keyword | |
75 | | -| `get_standards` | Coding standards from local documentation | |
| 120 | +## How It Works |
| 121 | +
|
| 122 | +1. **Fetch**: When you mention a ticket, DevsContext fetches from all configured sources in parallel |
| 123 | +2. **Extract**: It finds relevant content — ticket matches docs by component/label, searches meeting transcripts for keywords |
| 124 | +3. **Synthesize**: An LLM combines raw data into a structured context block with sources cited |
| 125 | +
|
| 126 | +No background processes. No vector database. Just on-demand fetching and synthesis. |
| 127 | +
|
| 128 | +## MCP Tools |
| 129 | +
|
| 130 | +| Tool | When to Use | Example | |
| 131 | +|------|-------------|---------| |
| 132 | +| `get_task_context` | Starting work on a ticket | "work on PROJ-123" | |
| 133 | +| `search_context` | Questions about architecture or past decisions | "how do we handle payment retries?" | |
| 134 | +| `get_standards` | Checking coding conventions | "what are our testing standards?" | |
76 | 135 |
|
77 | 136 | ## Development |
78 | 137 |
|
79 | 138 | ```bash |
80 | | -# Install from source |
81 | | -git clone https://github.com/yourusername/devscontext.git |
| 139 | +git clone https://github.com/anthropics/devscontext.git |
82 | 140 | cd devscontext |
83 | 141 | pip install -e ".[dev]" |
84 | 142 |
|
85 | | -# Run the MCP server |
86 | | -devscontext serve |
87 | | -
|
88 | 143 | # Run tests |
89 | 144 | pytest |
90 | 145 |
|
91 | | -# Linting |
92 | | -ruff check src/ |
| 146 | +# Lint |
| 147 | +ruff check . && mypy src/ |
93 | 148 | ``` |
94 | 149 |
|
95 | | -## Status |
| 150 | +## Contributing |
| 151 | + |
| 152 | +Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. |
96 | 153 |
|
97 | | -Early development — contributions welcome! |
| 154 | +Ideas for contributions: |
| 155 | +- New adapters (Linear, Notion, Confluence) |
| 156 | +- Better keyword extraction |
| 157 | +- Caching improvements |
98 | 158 |
|
99 | 159 | ## License |
100 | 160 |
|
|
0 commit comments