UNPKG

cpp-enhancement-mcp-server

Version:

MCP server for C++ programming enhancement with modern best practices, performance optimization, and real-time web research. Requires Python 3.8+.

218 lines (158 loc) 4.39 kB
# Publishing Guide for C++ Enhancement MCP Server This guide walks you through testing and publishing the C++ Enhancement MCP Server to npm. ## Prerequisites 1. **Node.js and npm**: Install from [nodejs.org](https://nodejs.org/) 2. **Python 3.8+**: Required for running the MCP server 3. **npm account**: Create at [npmjs.com](https://www.npmjs.com/) ## Testing the MCP Server ### 1. Run the Test Suite ```bash # Run comprehensive tests py test_mcp_server.py ``` This will test: - ✅ Knowledge base integrity - ✅ Code analysis functionality - ✅ Best practices retrieval - ✅ Modern alternatives suggestions - ✅ Performance optimization tips - ✅ Memory management advice - ✅ Template programming help - ✅ Web search capabilities ### 2. Run the Demo ```bash # Interactive demo of all features py demo_cpp_enhancement.py ``` ### 3. Test MCP Integration (if MCP library is installed) ```bash # Install MCP library pip install mcp # Test actual MCP server py cpp_enhancement_server.py ``` ## Publishing to npm ### 1. Prepare for Publishing ```bash # Run the publishing script py publish.py ``` This script will: - ✅ Check prerequisites - ✅ Run test suite - ✅ Create executable scripts - ✅ Check npm login status - ✅ Perform dry run - ✅ Publish to npm ### 2. Manual Publishing Steps If you prefer manual control: ```bash # 1. Login to npm npm login # 2. Test the package npm run test # 3. Dry run publish npm publish --dry-run # 4. Actual publish npm publish ``` ## Post-Publishing ### 1. Test Installation ```bash # Test global installation npx cpp-enhancement-mcp-server # Or install locally npm install cpp-enhancement-mcp-server ``` ### 2. Verify Package - Check package page: https://www.npmjs.com/package/cpp-enhancement-mcp-server - Test download and installation - Verify all files are included ## MCP Client Configuration ### Claude Desktop Add to `claude_desktop_config.json`: ```json { "mcpServers": { "cpp-enhancement": { "command": "npx", "args": ["cpp-enhancement-mcp-server"], "env": {} } } } ``` ### Other MCP Clients Use the configuration from `mcp_config.json` and adapt as needed. ## Troubleshooting ### Common Issues 1. **Python not found** - Ensure Python 3.8+ is installed - Check PATH environment variable 2. **npm publish fails** - Verify npm login: `npm whoami` - Check package name availability - Ensure version is incremented 3. **MCP server doesn't start** - Check Python dependencies - Verify file permissions on Unix systems ### Debug Commands ```bash # Check npm configuration npm config list # Verify package contents npm pack tar -tzf cpp-enhancement-mcp-server-*.tgz # Test executable ./cpp-enhancement-server --help ``` ## Version Management ### Updating Versions ```bash # Patch version (1.0.0 -> 1.0.1) npm version patch # Minor version (1.0.0 -> 1.1.0) npm version minor # Major version (1.0.0 -> 2.0.0) npm version major ``` ### Publishing Updates ```bash # After version bump npm publish ``` ## Package Structure ``` cpp-enhancement-mcp-server/ ├── package.json # npm package configuration ├── README.md # Main documentation ├── LICENSE # MIT license ├── cpp_enhancement_server.py # Main MCP server ├── demo_cpp_enhancement.py # Demo script ├── test_mcp_server.py # Test suite ├── install.py # Installation helper ├── publish.py # Publishing helper ├── requirements.txt # Python dependencies ├── cpp-enhancement-server # Unix executable ├── cpp-enhancement-server.bat # Windows executable ├── claude_desktop_config.json # Claude Desktop config ├── mcp_config.json # Generic MCP config └── .npmignore # npm ignore file ``` ## Success Criteria Before publishing, ensure: - ✅ All tests pass (100% success rate) - ✅ Demo runs without errors - ✅ Package.json is valid - ✅ README is comprehensive - ✅ License is included - ✅ Executable scripts work on target platforms - ✅ npm dry-run succeeds ## Support For issues: 1. Check this guide 2. Run test suite to identify problems 3. Review error messages carefully 4. Check npm and Python versions --- **Ready to publish? Run `py publish.py` to get started!**