github-knowledge-graph-mcp
v1.0.1
Published
MCP Server for GitHub Knowledge Graph Analysis
Maintainers
Readme
GitHub Knowledge Graph MCP Server
Generate and interact with knowledge graphs of GitHub repositories using the Model Context Protocol (MCP).
Installation
# Install globally
npm install -g github-knowledge-graph-mcp
# Or install locally
npm install github-knowledge-graph-mcpQuick Start
# Start the MCP server
github-kg-mcpOr run directly with npx:
npx github-knowledge-graph-mcpEnvironment Variables
The server can be configured with the following environment variables:
| Variable | Description | Default |
|----------|-------------|---------|
| MCP_PORT | The port to run the MCP server on | 3100 |
| MCP_HOST | The host to bind the MCP server to | localhost |
| MCP_DATA_DIR | Directory to store knowledge graphs | $HOME/.github-knowledge-graph/data |
| MCP_LOG_LEVEL | Logging level (debug, info, warn, error) | info |
Example:
# Set custom configuration
export MCP_PORT=3200
export MCP_DATA_DIR=$HOME/github-kg-data
github-kg-mcpClaude Desktop Integration
You can automatically configure Claude Desktop to use this MCP server:
# If installed globally
npx github-knowledge-graph-mcp install-claude
# Or if installed locally
npm run install-claudeThis will add the MCP server configuration to your Claude Desktop config file located at:
%APPDATA%\Claude\claude_desktop_config.json (Windows) or
$HOME/Library/Application Support/Claude/claude_desktop_config.json (macOS)
API Usage
The server implements the Model Context Protocol (MCP), enabling AI models to analyze and explore code repositories.
Available Functions
analyze_repository- Generate a knowledge graph from a GitHub repositoryget_analysis_status- Check status of an ongoing analysisget_analysis_result- Retrieve completed analysis and save as a knowledge graphexplore_graph- Navigate and explore the knowledge graphsearch_nodes- Find nodes matching specific criteriaget_node_details- Get detailed information about a specific nodefind_dependencies- Analyze dependencies and dependents of a nodeget_graph_statistics- Get overview statistics for a knowledge graphfind_circular_dependencies- Detect circular dependencies in the codebase
Advanced Usage
// Example: Custom server configuration
import { startMcpServer } from 'github-knowledge-graph-mcp';
startMcpServer({
port: 4000,
dataDir: '/custom/data/path',
logLevel: 'debug'
});License
MIT
