@@ -13,11 +13,24 @@ context block, and returns it through MCP.
1313## Architecture
1414- MCP server using the official Python MCP SDK (` mcp ` package)
1515- On-demand fetching: no background processes, no vector DB, no daemons
16- - Flow: MCP tool call -> fetch from APIs in parallel -> LLM synthesis -> return
1716- Sources: Jira REST API, Fireflies GraphQL API, local markdown docs
1817- Synthesis: LLM (Claude Haiku / GPT-4o-mini / Ollama) combines raw data into structured block
1918- Cache: simple in-memory TTL cache, no persistent storage
2019
20+ ### Fetch Strategy (Two-Phase)
21+ For ` get_task_context ` , we use a two-phase fetch:
22+ 1 . ** Phase 1:** Fetch Jira ticket first (need ticket data for doc/meeting matching)
23+ 2 . ** Phase 2:** Fetch meetings and docs in parallel, using ticket title/components/labels
24+ - Meetings: search by ticket ID AND keywords from ticket title
25+ - Docs: match by components, labels, keywords; always include standards
26+
27+ This ensures docs and meetings are contextually relevant to the specific ticket.
28+
29+ ### Tool Behaviors
30+ - ` get_task_context ` : Full LLM synthesis, cached
31+ - ` search_context ` : No LLM, no cache (fast freeform search)
32+ - ` get_standards ` : No LLM, no cache (direct doc retrieval)
33+
2134## Tech Stack
2235- Python 3.11+
2336- ` mcp ` - MCP Python SDK for server implementation
@@ -45,6 +58,7 @@ context block, and returns it through MCP.
4558- ` src/devscontext/cache.py ` - in-memory TTL cache
4659- ` src/devscontext/config.py ` - YAML config loading and validation
4760- ` src/devscontext/cli.py ` - CLI commands (init, test, serve)
61+ - ` src/devscontext/utils.py ` - text utilities (keyword extraction, truncation)
4862
4963## MCP Tools (3 total)
50641 . ` get_task_context(task_id: str) ` - full synthesized context for a Jira ticket
@@ -59,6 +73,19 @@ context block, and returns it through MCP.
5973- Auth credentials via environment variables only (never in config file)
6074- Graceful degradation: if Fireflies is not configured, skip it and return Jira + docs only
6175
76+ ### Local Docs Matching
77+ Local docs are matched to tickets via:
78+ 1 . Components → doc filenames and headings
79+ 2 . Labels → doc filenames and headings
80+ 3 . Keywords from ticket title → doc content
81+ 4 . Standards docs (CLAUDE.md, .cursorrules, standards/) are always included
82+
83+ Docs are classified by path:
84+ - ` architecture/ ` , ` arch/ ` → architecture docs
85+ - ` standards/ ` , ` style/ ` , ` coding/ ` → coding standards
86+ - ` adr/ ` , ` adrs/ ` → architecture decision records
87+ - ` CLAUDE.md ` , ` .cursorrules ` → standards (special files)
88+
6289## Testing
6390- Use pytest with pytest-asyncio
6491- Mock external APIs in tests (httpx mock)
0 commit comments