Commands-com/test-mcp-server
If you are the rightful owner of test-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This document provides a comprehensive guide to setting up and deploying an MCP server using the create-commands-mcp template.
ping
Test server connectivity
echo
Echo back user input
datetime
Get current date/time in various formats
my-server
MCP server created with api template
Created with create-commands-mcp
Quick Start
# Install dependencies
npm install
# Configure environment (optional)
cp .env.example .env
# Customize settings if needed - works out of the box!
# Start development server
npm run dev
# Test your server
curl http://localhost:3000/health
Available Tools
- ping - Test server connectivity
- echo - Echo back user input
- datetime - Get current date/time in various formats
Development
Adding New Tools
Quick Start
- Create a new tool file in
src/tools/
:
// src/tools/myTool.ts
export const myTool = {
name: "my_tool",
description: "Does something useful - be specific for better AI usage",
inputSchema: {
type: "object",
properties: {
input: {
type: "string",
description: "Clear description helps AI understand when to use this tool"
}
},
required: ["input"]
},
handler: async (args: { input: string }) => {
// Your tool logic here
return {
success: true,
result: `Processed: ${args.input}`,
// Return structured data when possible
};
}
};
- Export from
src/tools/index.ts
:
export { myTool } from './myTool';
- Test your tool:
npm run dev # Start server
npm run doctor # Verify tool registration
Tool Design Best Practices
- š Clear descriptions - AI needs to understand when to use your tool
- š§ Specific input schemas - Define exactly what parameters you need
- ā Error handling - Return meaningful error messages
- š Structured output - Consistent response format helps AI usage
- š Performance - Keep tools fast (< 30s timeout recommended)
Documentation & Examples
- š MCP Tool Guidelines - Comprehensive tool development guide
- šÆ Tool Design Patterns - Common patterns and examples
- š Schema Reference - Input/output schema documentation
- š” Community Examples - Real-world tool implementations
Testing
# Run all tests
npm test
# Watch mode
npm run test:watch
# Health check
npm run doctor
Building
# Build TypeScript
npm run build
# Start production server
npm start
Commands.com Integration
JWT Validation (Works Immediately)
Your server automatically validates Commands.com JWTs using public JWKS:
# No setup required - works out of the box
npm run dev
# Test with any Commands.com JWT token
curl -H "Authorization: Bearer JWT_TOKEN" http://localhost:3000/ping
Gateway Integration (Optional)
To list your server on Commands.com and receive gateway traffic:
- Deploy your server to any hosting platform (Railway, Vercel, AWS, etc.)
- Register at Commands.com Creator Portal
- Configure your server's proxy URL in the Commands.com UI
- Commands.com gateway routes user requests to your self-hosted server
- You handle all server hosting and scaling
# Verify configuration
npm run doctor
Deployment
Railway (Recommended for Testing)
Quick Deploy in 2 minutes:
-
Push to GitHub:
git init && git add . && git commit -m "Initial commit" git remote add origin https://github.com/yourusername/my-server.git git push -u origin main
-
Connect to Railway:
- Visit railway.app
- Connect your GitHub repository
- Railway auto-detects and deploys instantly
-
Get live URL:
- Your server:
https://my-server-production.up.railway.app
- Test health:
curl https://my-server-production.up.railway.app/health
- Your server:
Environment variables (optional):
- Set in Railway dashboard if needed
- Server works out-of-the-box with defaults
Vercel
- Connect your repository to Vercel
- Configure environment variables
- Deploy serverless functions
Docker
# Build image
docker build -t my-server .
# Run container
docker run -p 3000:3000 --env-file .env my-server
Commands.com Marketplace
Why Commands.com?
Commands.com provides a complete business platform for just 15% revenue share:
- šÆ Marketing & Discovery - Marketplace promotion and user acquisition
- š³ Stripe Billing - Payment processing and subscription management
- š OAuth & Auth - User management and secure access
- š Analytics - Usage tracking and performance insights
- š Gateway Routing - Routes users to your self-hosted server
You keep 85% of revenue while hosting your own infrastructure.
Submit Your Server
- Deploy your server to any hosting platform
- Test your server:
npm run commands:validate
- Submit to marketplace: Commands.com Creator Portal
Marketplace Guidelines
- ā All tools must have clear descriptions
- ā Error handling for all edge cases
- ā Proper JWT authentication
- ā Health check endpoint working
- ā Rate limiting respected
Architecture
src/
āāā index.ts # Main server entry point
āāā tools/ # Tool implementations
ā āāā index.ts # Tool exports
ā āāā ping.ts # Connectivity test
ā āāā echo.ts # Input/output test
ā āāā datetime.ts # System integration
āāā auth/
ā āāā verifyToken.ts # JWT validation
āāā types.ts # TypeScript definitions
āāā scripts/
āāā doctor.ts # Health checks
āāā validate-commands.ts
Security
- ā JWT tokens validated against Commands.com JWKS
- ā Input validation on all tools
- ā No secrets logged or exposed
- ā CORS configured for Commands.com domains
- ā Rate limiting implemented
Support
- š Documentation
- š¬ Discord Community
- š Report Issues
License
MIT