Introduction¶
When developing LLM-based agents, the accuracy of code generation often depends on context information. If the LLM references outdated library documentation, the generated code may contain errors or deprecated APIs. Context7 MCP aims to solve this problem.
Plugin Overview¶
This is a plugin for DeepSeek Harness (DSH), maintained by xby-skill. It integrates the Context7 MCP service, providing LLMs with the latest code documentation and examples, ensuring that agent-generated code is based on current library documentation.
Core Capabilities¶
This plugin provides the following core capabilities:
- set_xby_apikey: Sets the API key in the chat. The key is automatically persisted and remains valid after restarting DSH.
- resolve_library_id: Resolves a package name or product name, converts it to a Context7-compatible library ID, and returns a list of matches.
- get_library_docs: Retrieves the latest documentation for a specified library.
Installation¶
Run the following command in the command line to complete the installation:
dsh plugin --profile web add github:xby_skill/xby-code-document-update
Usage Instructions¶
Before using this plugin, you need to register on the Xiaoben Yang official website to obtain an API key.
Before calling get_library_docs to retrieve documentation, you typically need to call resolve_library_id first to obtain a valid Context7-compatible library ID. Unless the user directly provides a library ID in /org/project or /org/project/version format in the query, resolution must be performed first.
When retrieving documentation, you can specify a mode via the mode parameter:
- mode='code' (default): For API references and code examples.
- mode='info': For conceptual guides, narrative information, and architecture questions.
Notes¶
- Local debugging: This plugin is intended for local development and debugging only.
- Ambiguous queries: For ambiguous or uncertain queries, ask the user for clarification before attempting guessed matching.
- API key: Before use, visit the Xiaoben Yang official website to register and obtain an API key.
Summary¶
By integrating Context7 MCP, this plugin solves the problem of LLMs relying on outdated documentation during code generation. For more details, see the plugin directory or the GitHub repository.