Code Reader MCP Server

Code Reader MCP Server

An MCP server that connects to your GitHub repositories, detects API changes, and provides context for Cursor to automatically generate test cases.

Category
访问服务器

README

Code Reader - MCP Server

An MCP (Model Context Protocol) server that connects to your GitHub repositories, detects API changes, and provides context for Cursor to automatically generate test cases.

Features

  • 🔍 Detect API Changes: Compare branches/commits to find new or modified API endpoints
  • 📂 Multi-Service Support: Configure multiple services with their automation repos
  • 🔗 GitHub Integration: Fetch file contents, commits, PRs directly from GitHub
  • 📝 Test Templates: Get starter templates for REST, GraphQL, and gRPC APIs
  • 🤖 Cursor Integration: Provides tools that Cursor can use to understand your API changes

Configured Services

This MCP server is configured for the following Bliklan services:

Service Repository
bliklan-campaign-management gdncomm/bliklan-campaign-management
bliklan-tracker-aggregator gdncomm/bliklan-tracker-aggregator
bliklan-compute-engine gdncomm/bliklan-compute-engine
bliklan-credit gdncomm/bliklan-credit
bliklan-ads-engine gdncomm/bliklan-ads-engine

Prerequisites

  • Node.js 18+ (we recommend using nvm)
  • npm (comes with Node.js)
  • GitHub Fine-Grained Personal Access Token (required for gdncomm org)
  • Cursor IDE

Check Your Node.js Version

node --version
# Should be v18.x.x or higher (v20.x or v21.x recommended)

If you're using an older version, install a newer one via nvm:

nvm install 21
nvm use 21
nvm alias default 21

Quick Start

Step 1: Clone the Repository

git clone <repository-url>
cd api-test-mcp-server

Step 2: Install Dependencies

npm install

Step 3: Build the Server

npm run build

This creates the dist/index.js file that Cursor will run.

Step 4: Create a GitHub Fine-Grained Token

⚠️ Important: The gdncomm organization requires a fine-grained personal access token (classic tokens won't work).

  1. Go to: https://github.com/settings/tokens?type=beta
  2. Click "Generate new token"
  3. Configure:
    • Token name: api-test-mcp-server
    • Expiration: Choose appropriate duration
    • Resource owner: Select gdncomm organization
    • Repository access: Select "Only select repositories" → choose the repos you need
    • Permissions (Repository permissions):
      • Contents: Read-only
      • Metadata: Read-only
      • Pull requests: Read-only
      • Commit statuses: Read-only
  4. Click Generate token
  5. Copy the token (starts with github_pat_)

Step 5: Configure Cursor MCP

Create or edit ~/.cursor/mcp.json:

{
  "mcpServers": {
    "api-test-server": {
      "command": "/path/to/your/node",
      "args": ["/path/to/api-test-mcp-server/dist/index.js"],
      "env": {
        "GITHUB_TOKEN": "github_pat_your_token_here",
        "DEFAULT_BASE_BRANCH": "master",
        "SERVICES_CONFIG": "[{\"name\":\"bliklan-campaign-management\",\"repoOwner\":\"gdncomm\",\"repoName\":\"bliklan-campaign-management\",\"automationRepoPath\":\"/Users/yourname/automation-repos/bliklan-campaign-management\",\"apiPatterns\":[\"**/controllers/**\",\"**/routes/**\",\"**/api/**\",\"**/*Controller*\",\"**/*Router*\"]},{\"name\":\"bliklan-tracker-aggregator\",\"repoOwner\":\"gdncomm\",\"repoName\":\"bliklan-tracker-aggregator\",\"automationRepoPath\":\"/Users/yourname/automation-repos/bliklan-tracker-aggregator\",\"apiPatterns\":[\"**/controllers/**\",\"**/routes/**\",\"**/api/**\",\"**/*Controller*\",\"**/*Router*\"]},{\"name\":\"bliklan-compute-engine\",\"repoOwner\":\"gdncomm\",\"repoName\":\"bliklan-compute-engine\",\"automationRepoPath\":\"/Users/yourname/automation-repos/bliklan-compute-engine\",\"apiPatterns\":[\"**/controllers/**\",\"**/routes/**\",\"**/api/**\",\"**/*Controller*\",\"**/*Router*\"]},{\"name\":\"bliklan-credit\",\"repoOwner\":\"gdncomm\",\"repoName\":\"bliklan-credit\",\"automationRepoPath\":\"/Users/yourname/automation-repos/bliklan-credit\",\"apiPatterns\":[\"**/controllers/**\",\"**/routes/**\",\"**/api/**\",\"**/*Controller*\",\"**/*Router*\"]},{\"name\":\"bliklan-ads-engine\",\"repoOwner\":\"gdncomm\",\"repoName\":\"bliklan-ads-engine\",\"automationRepoPath\":\"/Users/yourname/automation-repos/bliklan-ads-engine\",\"apiPatterns\":[\"**/controllers/**\",\"**/routes/**\",\"**/api/**\",\"**/*Controller*\",\"**/*Router*\"]}]"
      }
    }
  }
}

Important: Find Your Node Path

If you're using nvm, you need to use the full path to node:

# Find your node path
which node
# Example output: /Users/yourname/.nvm/versions/node/v21.5.0/bin/node

Use this full path in the "command" field.

Update Paths

Replace in the config:

  • /path/to/your/node → Your actual node path (from which node)
  • /path/to/api-test-mcp-server → Where you cloned this repo
  • /Users/yourname/automation-repos/ → Your actual automation repos path
  • github_pat_your_token_here → Your actual GitHub token

Step 6: Restart Cursor

Completely quit Cursor (Cmd+Q on macOS) and reopen it. The MCP server only loads at startup.

Step 7: Verify Setup

In Cursor, check Settings → Features → MCP Servers. You should see api-test-server with a green status.

If you see a red status, check the error message:

  • "Cannot use import statement outside a module" → Wrong Node.js version (need 18+)
  • "Service not found" → SERVICES_CONFIG not set correctly
  • "Bad credentials" → GitHub token is invalid or expired

Available Tools

Once configured, you can ask Cursor to use these tools:

Tool Description Example
list_services List all configured services "List all services"
get_recent_commits Get recent commits for a service "Get recent commits for bliklan-campaign-management"
get_api_changes Get API changes between branches "Get API changes between master and feature/xyz"
get_api_details Get full content of an API file "Get the StoreAdsCampaignController.java file"
get_pull_requests Get PRs for a service "Show open PRs for bliklan-credit"
analyze_api_endpoint Extract endpoint definitions from a file "Analyze endpoints in UserController.java"
get_test_template Get a test template for REST/GraphQL/gRPC "Get a REST test template"
compare_branches Compare branches and summarize changes "Compare master and release/SP22"

Usage Examples

Example 1: List Services and Get Recent Commits

Use the api-test-server to list services, then get recent commits for bliklan-campaign-management

Example 2: Find API Logic

Use the api-test-server to find the logic for storeads/save-campaign API in bliklan-campaign-management

Example 3: Check Recent Changes

Get the recent commits for bliklan-credit service and show me any API-related changes

Example 4: Analyze API File

Use the MCP server to get the content of src/main/java/com/gdn/bliklan/campaignmanagement/controller/StoreAdsCampaignController.java from bliklan-campaign-management

Example 5: Compare Branches

Compare master and release/SP22_RELEASE_01 branches in bliklan-campaign-management to find API changes

Testing the MCP Server

Simply ask Cursor to use the tools (this is the normal workflow).


MCP Server Shows Red Status

  1. Check Cursor Developer Tools: Help → Toggle Developer Tools → Console
  2. Look for error messages related to "mcp" or "api-test-server"
  3. Verify the node path is correct (use full path from which node)
  4. Make sure the dist/index.js file exists (run npm run build)

No API Changes Detected

  1. Verify apiPatterns match your file structure
  2. Check if the branches you're comparing exist
  3. Try broader patterns like **/*.java for testing

Adding New Services

To add a new service, update the SERVICES_CONFIG in ~/.cursor/mcp.json:

or copy the file cp /Users/ruthsan/api-test-mcp-server/cursor-mcp-config.json ~/.cursor/mcp.json

{
  "name": "new-service-name",
  "repoOwner": "gdncomm",
  "repoName": "new-service-repo",
  "automationRepoPath": "/path/to/automation/new-service",
  "apiPatterns": [
    "**/controllers/**",
    "**/routes/**",
    "**/api/**",
    "**/*Controller*"
  ]
}

Then restart Cursor.


API Patterns

Configure apiPatterns to match your codebase structure:

For Spring Boot (Java):

"apiPatterns": [
  "**/controller/**",
  "**/rest/**",
  "**/*Controller.java",
  "**/*Resource.java"
]

Development

Run in Development Mode

npm run dev

Watch for Changes

npm run watch

Build

npm run build

Project Structure

api-test-mcp-server/
├── src/
│   └── index.ts          # Main MCP server implementation
├── dist/                  # Compiled JavaScript (generated)
├── package.json           # Dependencies and scripts
├── tsconfig.json          # TypeScript configuration
├── cursor-mcp-config.json # Example Cursor MCP configuration
├── config.example.json    # Example service configuration
└── README.md              # This file

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选