Basic information
About Repo Context Mcp Server
Repo Context MCP provides programmatic access to repository contents for integrations and automation. It can list directories/files, read any file, return the README, perform TypeScript type analysis (via ts-morph), and search for OpenAPI/Swagger spec files. Supports local repo p
Repo Context Mcp is a MCP server in the Version Control category listed in the AddMCP.net directory, published by pablo-peek. It exposes 8 tools, including setRepoPath, getFiles, getFileContent, getReadme and more. Supported transport: stdio. Runtime: TypeScript. License: ISC. The repository has 1 GitHub stars. Source code is hosted on github.com. Related topics: analyzer, documentation, endpoints, github, openapi.
Setup
{
"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>"
}
}
}
}
{
"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>"
}
}
}
}
{
"servers": {
"repo-context": {
"type": "stdio",
"command": "npx",
"args": [
"@pablopeek/repo-context-mcp"
],
"env": {
"ENVIRONMENT": "local",
"GITHUB_TOKEN": "<SET_GITHUB_TOKEN>",
"GITHUB_NAME": "<SET_GITHUB_NAME>"
}
}
}
}
Repo Context Mcp config
Add this server to your MCP-compatible client using the configuration below.
{
"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>"
}
}
}
}
Repo Context Mcp tools
-
setRepoPath
— Change the active repository path
path:string* -
getFiles
— List files and folders at the given path in the active repo
path:string -
getFileContent
— Read the content of a file in the active repo
file:string* -
getReadme
— Read the README.md file from the active repo
(no parameters) -
analyzeFileTypes
— Analyze a file and return exported functions and the type of their parameters (if available)
file:string* -
analyzeFileTypesAdvanced
— Analyze a file using ts-morph and return exported functions and the type of their parameters (resolving local and imported types)
file:string* -
getGithubFileContent
— Read the content of a file from a (private) GitHub repository using the GitHub API.
owner:string*, repo:string*, path:string*, ref:string -
getSwaggerSpec
— Read the Swagger/OpenAPI specification file (swagger.json, openapi.json, openapi.yaml, etc.) from the active repo.
path:string
Overview
What is Repo Context Mcp?
It is a programmatic MCP server to explore repositories, either local or from GitHub. It can list files, read file contents, return README, analyze TypeScript types using ts-morph, and locate OpenAPI/Swagger specs. It is intended for developers who want to programmatically interact with repository contents via an MCP interface.
How to use Repo Context Mcp?
Set environment variables GITHUB_TOKEN and GITHUB_NAME (do not store tokens in config files). Then invoke the server and use its tools such as setRepoPath, getFiles, getFileContent, getReadme, analyzeFileTypes, analyzeFileTypesAdvanced, getGithubFileContent, and getSwaggerSpec.
Key features of Repo Context Mcp
- Set active repository path via setRepoPath
- List files and folders with getFiles
- Read file contents using getFileContent
- Return root README.md with getReadme
- Analyze TypeScript types with analyzeFileTypes (simple) and analyzeFileTypesAdvanced (ts-morph)
- Fetch files from GitHub using getGithubFileContent (requires GITHUB_TOKEN)
- Search for OpenAPI/Swagger specs with getSwaggerSpec
Use cases of Repo Context Mcp
- Programmatically explore a local codebase through MCP tools
- Retrieve specific file contents from a GitHub repository without cloning
- Analyze TypeScript type exports in a project
- Locate and inspect OpenAPI/Swagger specification files in a repository
Frequently asked questions
1 What environment variables are required?
GITHUB_TOKEN and GITHUB_NAME must be set. The token should never be stored in config files.
2 What repositories can Repo Context MCP access?
It can access both local file system repositories (via setRepoPath) and GitHub repositories (via getGithubFileContent using the token).
3 What tools does Repo Context MCP provide?
It provides setRepoPath, getFiles, getFileContent, getReadme, analyzeFileTypes, analyzeFileTypesAdvanced, getGithubFileContent, and getSwaggerSpec.
4 How does TypeScript analysis work?
analyzeFileTypes performs a simple exported function scan, while analyzeFileTypesAdvanced uses ts-morph resolution which may require project dependencies.
5 Can it find OpenAPI/Swagger specs?
Yes, getSwaggerSpec searches common locations for OpenAPI/Swagger specification files.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In