
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
dependency-context
Advanced tools
MCP server for providing dependency documentation context to AI assistants
An MCP server that provides AI assistants with contextual access to your project's dependency documentation, enabling more accurate responses about libraries and frameworks used in your codebase.
The recommended way to specify which dependencies you want to index is by creating a custom dependency-context.json
file in your project root. This allows you to:
Create a dependency-context.json
file in your project root with the following format:
{
"express": "^4.17.1",
"axios": "1.0.0"
}
If a dependency-context.json
file is not present, Dependency Context falls back to scanning package.json
or requirements.txt
.
{
"mcpServers": {
"dependency-context": {
"command": "npx",
"args": ["-y", "--package=dependency-context", "dependency-context"],
"env": {
"GITHUB_TOKEN": "YOUR_GITHUB_TOKEN_HERE", // Optional but recommended
"MODEL_NAME": "Xenova/all-MiniLM-L6-v2", // Optional, default shown
"DEBUG": "false", // Optional, default shown
"MIN_CHUNK_SIZE": "800", // Optional, default shown
"MAX_CHUNK_SIZE": "8000", // Optional, default shown
"CHUNKS_RETURNED": "5" // Optional, default shown
}
}
}
}
Enable the MCP in your editor
Prompt the AI to initialialize dependency-context. Make sure you are in "Agent" mode.
Can you initialize dependency-context?
If you prefer to just download and browse the dependency documentation without vector search:
npm install -g dependency-context
# From your project directory
dependency-context download
# Or specify a different project path
dependency-context download /path/to/your/project
dependency-context
folder in your project:# Explore the documentation
cd dependency-context
ls
Each dependency will have its own folder containing all the markdown documentation from its repository.
Dependency Context provides two main tools through its MCP interface:
Analyzes a project's dependencies and creates a searchable index of their documentation.
{
"capability": "InitializeDependencyIndex",
"parameters": {
"project_path": "/path/to/your/project",
"env_vars": {
"GITHUB_TOKEN": "your_github_token", // Optional but recommended
"MODEL_NAME": "Xenova/all-MiniLM-L6-v2", // Optional, default shown
"DEBUG": "true", // Optional
"MIN_CHUNK_SIZE": "800", // Optional, default shown
"MAX_CHUNK_SIZE": "8000" // Optional, default shown
}
}
}
This capability:
dependencies.json
file (recommended)Performs semantic search over indexed dependency documentation.
{
"capability": "searchDependencyDocs",
"parameters": {
"project_path": "/path/to/your/project",
"query": "How do I handle authentication?",
"repository_context": "express", // Optional: limit to a specific dependency
"env_vars": {
"MODEL_NAME": "Xenova/all-MiniLM-L6-v2",
"CHUNKS_RETURNED": "5" // Optional, default shown
}
}
}
Returns:
Dependency Context is built with a modular TypeScript architecture:
Core Components:
Key Libraries:
Run the test suite with:
npm test
For manual testing, follow these steps:
mkdir test-project
cd test-project
# Create a custom dependencies.json file (recommended approach)
echo '{
"dependencies": {
"express": "^4.17.1",
"axios": "^1.0.0"
}
}' > dependencies.json
# Alternatively, you can use standard dependency files:
# For Node.js projects
echo '{
"dependencies": {
"express": "^4.17.1",
"axios": "^1.0.0"
}
}' > package.json
# For Python projects
echo 'requests==2.26.0
numpy>=1.20.0' > requirements.txt
# Build and make the CLI executable
cd /path/to/dependency-context
npx fastmcp dev src/index.ts
# Initialize and index dependencies (from your test project directory)
tool(InitializeDependencyIndex)
# Search for information in the indexed dependencies
tool(searchDependencyDocs)
## Troubleshooting
### GitHub API Rate Limits
If you encounter "API rate limit exceeded" errors:
1. Create a GitHub personal access token at https://github.com/settings/tokens
2. Set it as the `GITHUB_TOKEN` environment variable:
```bash
export GITHUB_TOKEN=your_token_here
Or add it to your .env
file:
# Optional but recommended for higher API rate limits
GITHUB_TOKEN=your_token_here
# Optional settings with defaults shown below
MIN_CHUNK_SIZE=800
MAX_CHUNK_SIZE=8000
CHUNKS_RETURNED=5
If your searches return empty results:
If you encounter permission errors when accessing project directories:
# Clone the repository
git clone https://github.com/yourusername/dependency-context.git
# Install dependencies
cd dependency-context
npm install
# Run MCP server locally with fastmcp dev
npx fastmcp dev src/index.ts
# Test CLI download command
node src/index.js download ./test-project
Dependency Context is licensed under the MIT License with Commons Clause. This means you can:
✅ Allowed:
❌ Not Allowed:
See the LICENSE file for the complete license text and licensing details for more information.
Copyright © 2024 DarianB
FAQs
MCP server for providing dependency documentation context to AI assistants
We found that dependency-context demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.