This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
These rules override all other instructions:
- NEVER commit directly to main - Always create a feature branch and submit a pull request
- Conventional commits - Format:
type(scope): description - GitHub Issues for TODOs - Use
ghCLI to manage issues, no local TODO files. Use conventional commit format for issue titles - Pull Request titles - Use conventional commit format (same as commits)
- Branch naming - Use format:
type/scope/short-description(e.g.,feat/tools/new-tool) - Working an issue - Always create a new branch from an updated main branch
- Check branch status before pushing - Verify the remote tracking branch still exists. If a PR was merged/deleted, create a new branch from main instead
- Write tests - All new/refactored code requires tests where applicable
- Run validation before commits - Run
npm run buildandnpm run testand verify no errors before committing - No co-authors - Do not add co-author information on commits or pull requests
- No "generated by" statements - Do not add generated-by statements on pull requests
gh issue list # List open issues
gh issue view <number> # View details
gh issue create --title "type(scope): description" --body "..."
gh issue close <number>| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation only |
refactor |
Code change that neither fixes a bug nor adds a feature |
test |
Adding or updating tests |
chore |
Maintenance tasks |
perf |
Performance improvement |
ci |
CI/CD changes |
Project Structure:
- Extension source in
src/directory - Main entry point:
src/extension.ts - Tools in
src/tools/ - Server implementation in
src/server/ - Tests co-located with source files (
*.test.ts)
Build Configuration:
- Build tool: esbuild
- Test framework: Vitest
- TypeScript strict mode
Package Naming:
- Package name:
codingwithcalvin-mcp - Publisher:
CodingWithCalvin - Command prefix:
codingwithcalvin.mcp.* - Configuration prefix:
codingwithcalvin.mcp.*
CI/CD:
- Build workflow: Automated build on push/PR
- Publish workflow: Automated VS Code Marketplace publishing
VSC-MCPServer is a Visual Studio Code extension that exposes an MCP (Model Context Protocol) server, providing access to VS Code's semantic code understanding capabilities. External tools can use MCP to access language server features like go-to-definition, find references, hover info, completions, and more.
# Install dependencies
npm install
# Build the extension
npm run build
# Run tests
npm run test
# Watch mode for development
npm run watch
# Run tests in watch mode
npm run test:watchThe extension consists of several key components:
-
extension.ts - Main VS Code extension entry point. Manages server lifecycle and registers commands.
-
server/mcpServer.ts - HTTP server that exposes MCP endpoints. Handles JSON-RPC requests for tool listing and execution.
-
tools/ - Individual tool implementations that wrap VS Code's language server APIs:
- Navigation:
goToDefinition,findReferences,documentSymbols,workspaceSymbols - Code intelligence:
hoverInfo,completions,signatureHelp,callHierarchy,typeHierarchy - Diagnostics & actions:
diagnostics,codeActions,applyCodeAction,renameSymbol - Formatting:
formatDocument,formatRange,organizeImports - Search:
workspaceFileSearch,workspaceTextSearch
- Navigation:
-
adapters/vscodeAdapter.ts - Abstraction layer for VS Code API interactions.
-
handlers/uriHandler.ts - Handles
vscode://codingwithcalvin.mcp/...URI protocol. -
config/settings.ts - Extension configuration management.
- TypeScript
- VS Code Extension API (v1.85+)
- MCP SDK (@modelcontextprotocol/sdk)
- Express (HTTP server)
- Vitest (testing)
- esbuild (bundling)
GitHub Actions workflows in .github/workflows/:
- build.yml - Triggered on push to main or PR. Builds and uploads VSIX artifact.
- publish.yml - Manual trigger to publish to VS Code Marketplace.
- Open the project folder in VS Code
- Run
npm install - Run
npm run build - Press F5 to launch the extension in Extension Development Host
- Test MCP server at
http://localhost:4000/mcp