codeprot-mcp-server
v1.1.4
Published
MCP Server for Code Protection with Agent Tools and Third-party API Integration
Downloads
404
Maintainers
Readme
CodeProt MCP Server
MCP Server provides secure API interfaces for IDEs that support the MCP protocol (such as Cursor), allowing you to view and resolve code issues directly in your IDE.
Quick Start Guide
1. Entry Setup
- Go to the user settings page: Click the Settings button near your user avatar in the lower right corner
- Find the 'MCP Server' option in the left navigation bar and click on it
- First-time use requires creating an MCP application to obtain access credentials
- After creating the application, you will receive an AppID and Secret for API authentication
2. Create MCP Server Application in CodeProt
- Create Application: Click the 'Create New Application' button
- Application Information: Fill in the application name and description (we recommend using meaningful names such as 'Cursor IDE Integration')
- Obtain Credentials: After successful creation, the system will display AppID and Secret
- Save Credentials: Please immediately copy and securely save these credentials. The Secret will only be displayed once.
- Application Status: You can enable or disable the application at any time
- Permission Management: You can set the access permission scope for the application
3. Configure in IDEs that Support MCP Server
Cursor IDE Configuration
- Open Cursor settings and select Tools & Integrations
- Find the MCP Server configuration section
- Configure the following parameters:
{
"mcpServers": {
"codeprot-mcp-server": {
"command": "npx",
"args": [
"-y",
"codeprot-mcp-server"
],
"env": {
"CODE_PROT_APP_ID": "YOUR_APP_ID",
"CODE_PROT_APP_SECRET": "YOUR_APP_SECRET"
}
}
}
}Note: Replace YOUR_APP_ID and YOUR_APP_SECRET with your actual application credentials.
Other IDEs
Configure according to the specific IDE's MCP support documentation.
Available Tools (exported)
The current server exports four tools (see src/tools/agentTools.ts):
- review_diff_changes
- Purpose: IDE-integrated pre-commit review for the current Git branch. Collects diffs and runs Code-Prot analysis to detect issues before committing.
- Auto params: workspace_path is auto-injected.
- Inputs (all optional unless noted):
- workspace_path: string (path)
- projects_path: string[]
- project_path: string (path)
- file_paths: string[] (limit analysis to these files)
- exclude_globs: string[] (e.g. ["/.test.", "/tests/", "/.spec."])
- direct_run_mode: 'plan' | 'run' (internal; use 'run' with project_path for immediate analysis)
- Typical prompts in Cursor:
- "Review current branch diffs"
- "Review only these files: src/a.ts, src/b.ts"
- "Review this project now (force run)"
- Behavior: When called without parameters, it returns a planning flow to first discover original project paths and then run analysis. When called with { project_path, direct_run_mode: 'run' } it executes immediately.
- get_open_pr_issues
- Purpose: Find open PR review issues for a repository or specific files.
- Inputs:
- repo_name?: string (required for direct fetch; if omitted, returns instructions to obtain it)
- branch_name?: string
- file_paths?: string | string[]
- Typical prompts in Cursor:
- "Find open PR review issues for repo my-project"
- "Find open issues for these files: src/a.ts, src/b.ts"
- "List open issues on branch feature/login for repo my-project"
- Notes: If repo_name is omitted, the tool returns a plan instructing how to detect repo_name (via git remote.origin.url or fallback to repo root directory name).
- resolve_open_pr_issues
- Purpose: Resolve/mark/update issue status in batch.
- Inputs:
- issue_ids: string[] (required)
- status: 'pending' | 'accepted' | 'completed' | 'rejected' (required)
- Typical prompts in Cursor:
- "Mark these issues as accepted: , "
- "Set status completed for issue "
- health_check
- Purpose: Ping Code-Prot API health/connectivity and verify credentials.
- Inputs: none
- Typical prompt: "Health Check"
Credentials required for API-backed tools: set environment variables CODE_PROT_APP_ID and CODE_PROT_APP_SECRET.
Using Tools in Cursor Chat
Health Check
- Prompt: "Health Check"
- What it does: Verifies service health and connectivity.
Get Current Code File Issue List (via get_open_pr_issues)
- Open a file, then prompt examples:
- "Find open PR review issues for these files: <relative/path/to/file>"
- "Find open PR review issues for repo <REPO_NAME>"
- Open a file, then prompt examples:
Update Issue Status (via resolve_open_pr_issues)
- Prompt: "Update Issue Status: mark , as accepted"
Pre-commit Diff Review (via review_diff_changes)
- Prompt: "Review current branch diffs"
- Optional: "Review only these files: src/tools/agentTools.ts, src/utils/logger.ts"
- Optional: "Exclude test files when reviewing"
Example Interaction
In Cursor AI Chat:
User: "Review current branch diffs" System: "Generated instructions to discover original project paths and run analysis. Then executes review and returns issues and guidance."
User: "Find open PR review issues for repo codeprot-mcp-server" System: "✅ Successfully retrieved 15 issues from repository codeprot-mcp-server"
Troubleshooting
Connection Issues
- Verify that your AppID and Secret are correct
- Check that the MCP server is properly configured in your IDE
- Run Health Check to verify service connectivity
Issue Detection Problems
- Ensure you're in a Git repository
- Verify that the repository name matches your CodeProt project
- Check that you have proper permissions for the application
Status Update Failures
- Confirm that issue IDs are valid
- Verify that you have write permissions
- Check the application status is active
Support
For issues, questions, or feature requests, please contact our support team at [email protected] or visit our documentation portal.
License
MIT License
