Visitar URL original
feat(#124): complete Context7 integration with tool access and docume… · randomm/opencode@6b31895 · GitHub
Skip to content

Commit 6b31895

Browse files
randommJanni Turunen
andauthored
feat(#124): complete Context7 integration with tool access and documentation (#125)
* feat(#122): add Context7 MCP server for up-to-date library documentation - Add Context7 configuration to both opencode.work.json and opencode.personal.json - Configure remote MCP server endpoint: https://mcp.context7.com/mcp - Set up CONTEXT7_API_KEY environment variable support - Update README.md to document Context7 integration - Add Context7 to environment variables section with setup instructions - Context7 provides access to 1000+ library documentation versions - Free tier: 10,000 calls per month via context7.com/dashboard * feat(#124): complete Context7 integration with tool access and documentation - Add context7 tool access to 11 programming agents in both config files - Add mandatory Context7 usage line to 9 agent prompts - Create instructions/context7-library-documentation.md with usage guide - Update AGENTS.md with Context7 section documenting capabilities and rate limits - Sync both opencode.work.json and opencode.personal.json configurations * fix(#124): sync instruction file arrays across configs --------- Co-authored-by: Janni Turunen <janni@Jannis-MacBook-Air.local>
1 parent 4b4aec2 commit 6b31895

13 files changed

Lines changed: 1404 additions & 1293 deletions

‎AGENTS.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ Every development issue MUST include these checkboxes:
136136
- Old `@aws-rds-postgresql-expert` → `@postgres-specialist`
137137
- All existing database work delegates to the single new agent
138138

139+
## Context7 - Library Documentation (Mandatory)
140+
141+
All programming agents MUST use Context7 for current library/framework documentation before implementing code. Provides up-to-date docs for 1000+ libraries including React, Python, Rust, Go, Ruby, Rails, and more. Tools: `resolve-library-id` (search library), `get-library-docs` (fetch docs). Rate limit: 10,000 calls/month. See: instructions/context7-library-documentation.md
142+
139143
## Remory Memory Integration
140144
All agents integrate with Remory, an advanced memory server that provides:
141145
- Semantic search with vector embeddings (vs simple text matching)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Context7 - Library Documentation MCP
2+
3+
## What Context7 Provides
4+
5+
Context7 is a Model Context Protocol (MCP) server that provides up-to-date documentation for 1000+ libraries and frameworks including:
6+
- **Languages**: Python, JavaScript/TypeScript, Go, Rust, Ruby, Java, C/C++, and more
7+
- **Frameworks**: React, Django, Rails, Express, FastAPI, Gin, Actix, and others
8+
- **Libraries**: Pandas, NumPy, Jest, Vitest, pytest, cargo, and thousands more
9+
- **Tools**: Build systems, package managers, testing frameworks, and utilities
10+
11+
## When to Use Context7
12+
13+
**Use Context7 BEFORE implementing any code** when working with:
14+
- Any third-party library or framework
15+
- New versions of familiar tools
16+
- API design with current best practices
17+
- Performance optimization patterns
18+
- Library selection decisions
19+
20+
## How to Use Context7
21+
22+
Context7 provides two main tools:
23+
24+
### resolve-library-id
25+
Searches for a library by name and returns its Context7 ID. Use this first to find the library you need.
26+
27+
```
28+
resolve-library-id: "React" → Returns Context7 ID for React
29+
resolve-library-id: "pandas" → Returns Context7 ID for pandas
30+
resolve-library-id: "pytest" → Returns Context7 ID for pytest
31+
```
32+
33+
### get-library-docs
34+
Retrieves current documentation for a specific library using its Context7 ID.
35+
36+
```
37+
get-library-docs: "<context7-id>" → Returns latest official docs
38+
```
39+
40+
## Rate Limits
41+
42+
- **Free tier**: 10,000 calls/month
43+
- **Sufficient for**: Regular development work with ~50-100 calls per day
44+
- Monitor usage if calling Context7 for every minor decision
45+
46+
## Context7 vs Perplexity
47+
48+
| Tool | Best For | When to Use |
49+
|------|----------|-------------|
50+
| **Context7** | Library/framework APIs and official docs | Before implementing with ANY library |
51+
| **Perplexity** | General research, comparisons, explanations | Understanding concepts, tool comparisons, debugging |
52+
53+
**Example**: Need React docs? → Context7. Need "why use React vs Vue?" → Perplexity.
54+
55+
## Quick Start
56+
57+
1. Search for your library: `resolve-library-id: "libraryname"`
58+
2. Get its docs: `get-library-docs: "<returned-id>"`
59+
3. Reference official documentation before coding
60+
4. Implement with current API knowledge
61+
62+
**Remember**: Always check official docs before making assumptions about library behavior or API changes.

0 commit comments

Comments
 (0)