- Repo Context Mcp
Repo Context Mcp
Repo Context MCP
A programmatic MCP server to explore repositories (local or GitHub). List files, read files, return README, analyze TypeScript types (ts-morph) and locate OpenAPI/Swagger specs.
Quick start
- Set env var (never store tokens in config): export GITHUB_TOKEN="<SET_YOUR_TOKEN>" export GITHUB_NAME="<SET_YOUR_NAME>"
Available tools
setRepoPath — set active repo path Payload: { "path": "/absolute/path/to/repo" }
getFiles — list files/folders Payload: { "path": "optional/relative/path" }
getFileContent — read file contents Payload: { "file": "relative/path/to/file.ext" }
getReadme — return README.md (root)
analyzeFileTypes — simple exported function scan Payload: { "file": "src/foo.ts" }
analyzeFileTypesAdvanced — ts-morph resolution (may require project deps)
getGithubFileContent — read file from GitHub (uses GITHUB_TOKEN) Payload: { "owner":"org","repo":"name","path":"path/to/file","ref":"branch?" }
getSwaggerSpec — search common locations for OpenAPI/Swagger specs
Contact Author: pablo-peek — repo: Repo Context MCP
Server Config
{
"mcpServers": {
"repo-context": {
"type": "stdio",
"command": "npx",
"args": [
"@pablopeek/repo-context-mcp"
],
"env": {
"ENVIRONMENT": "local",
"GITHUB_TOKEN": "<SET_GITHUB_TOKEN>",
"GITHUB_NAME": "<SET_GITHUB_NAME>"
}
}
}
}