dharmveer97/mcp-assistant-server
If you are the rightful owner of mcp-assistant-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 dayong@mcphub.com.
The MCP Assistant Server is a production-ready server designed to provide tools and resources for AI assistants, fully configured for deployment on Render.
MCP Assistant Server
A production-ready Model Context Protocol (MCP) server that provides tools and resources for AI assistants. This server is fully configured for deployment on Render and includes comprehensive examples of tools, resources, and best practices.
🚀 Features
Tools
- Weather Tool: Get current weather information for any city
- Calculator: Perform mathematical calculations
- Web Search: Search the web for information
- Date/Time: Get current date and time in various formats
- Text Processing: Process and analyze text with multiple operations
Resources
- System Information: Real-time system statistics
- Server Configuration: Current server settings
- Help Guide: Built-in documentation
Production Ready
- TypeScript with strict type checking
- Comprehensive error handling
- Winston logging
- Docker support
- Health checks
- Environment-based configuration
- Rate limiting ready
📋 Prerequisites
- Node.js 18+
- npm or yarn
- Git
🛠️ Installation
- Clone the repository:
cd mcp-server
- Install dependencies:
npm install
- Create environment file:
cp .env.example .env
- Build the project:
npm run build
🏃♂️ Running Locally
Development Mode
npm run dev
Production Mode
npm run build
npm start
With Docker
# Build the image
docker build -t mcp-assistant-server .
# Run the container
docker run -p 3000:3000 mcp-assistant-server
🚀 Deployment on Render
Quick Deploy
- Push your code to GitHub
- Connect your GitHub repository to Render
- Render will automatically detect the
render.yamlconfiguration - Click "Deploy"
Manual Setup
- Create a new Web Service on Render
- Connect your GitHub repository
- Configure:
- Build Command:
npm install && npm run build - Start Command:
npm start - Environment: Node
- Add environment variables from
.env.example
- Build Command:
Environment Variables
Set these in Render's dashboard:
NODE_ENV=productionPORT=3000LOG_LEVEL=info- Add any API keys as needed
📦 Project Structure
mcp-server/
├── src/
│ ├── index.ts # Main MCP server entry point
│ ├── server.ts # HTTP server for health checks
│ ├── tools/ # Tool implementations
│ │ ├── index.ts
│ │ ├── weather.ts
│ │ ├── calculator.ts
│ │ ├── search.ts
│ │ ├── date.ts
│ │ └── text-processing.ts
│ ├── resources/ # Resource handlers
│ │ ├── index.ts
│ │ ├── system-info.ts
│ │ ├── config.ts
│ │ └── help.ts
│ └── utils/
│ └── logger.ts # Winston logger configuration
├── dist/ # Compiled JavaScript (generated)
├── package.json
├── tsconfig.json
├── render.yaml # Render deployment config
├── Dockerfile
└── .env.example
🔧 Available Scripts
npm run build- Build TypeScript to JavaScriptnpm start- Start production servernpm run dev- Start development server with hot reloadnpm run lint- Run ESLintnpm run format- Format code with Prettiernpm run typecheck- Type check without buildingnpm test- Run testsnpm run clean- Clean build directory
📡 API Endpoints
Health Check
GET /health
Returns server health status
Server Info
GET /info
Returns server capabilities and version
🔌 MCP Protocol
This server implements the Model Context Protocol (MCP) which allows AI assistants to:
- Call Tools: Execute functions with parameters
- Read Resources: Access system information and configuration
- Handle Requests: Process tool and resource requests via stdio
Example Tool Call
{
"method": "tools/call",
"params": {
"name": "get_weather",
"arguments": {
"city": "New York",
"units": "fahrenheit"
}
}
}
Example Resource Read
{
"method": "resources/read",
"params": {
"uri": "system://info"
}
}
🔒 Security
- Environment variables for sensitive data
- Input validation on all tools
- Safe expression evaluation in calculator
- Non-root Docker user
- Rate limiting ready
- Comprehensive error handling
🐛 Troubleshooting
Build Errors
# Clean and rebuild
npm run clean
npm install
npm run build
Port Already in Use
# Change port in .env
PORT=3001
Docker Issues
# Rebuild without cache
docker build --no-cache -t mcp-assistant-server .
📈 Monitoring
The server includes:
- Health endpoint for uptime monitoring
- Winston logging with different levels
- Error tracking
- Performance metrics in system info
🤝 Contributing
- Fork the repository
- Create your feature branch
- Run tests and linting
- Commit your changes
- Push to the branch
- Open a Pull Request
📄 License
MIT License - feel free to use this in your projects!
🆘 Support
For issues or questions:
- Check the built-in help resource:
help://guide - Open an issue on GitHub
- Review the logs in production
🎯 Next Steps
After deployment:
- Test the health endpoint:
https://your-app.onrender.com/health - Configure any API keys needed for enhanced features
- Monitor logs in Render dashboard
- Scale as needed based on usage
Ready to Deploy! This MCP server is fully configured and ready for production use on Render. Simply push to GitHub and deploy! 🚀