usmanalisons/mcp_server
If you are the rightful owner of 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.
A comprehensive Model Context Protocol (MCP) server implementation in Node.js with TypeScript, designed to work with Claude Desktop and LibreChat.
weather
Get weather information for a location (mock data for demo).
MCP Server Node.js
A comprehensive Model Context Protocol (MCP) server implementation in Node.js with TypeScript, designed to work with Claude Desktop and LibreChat.
Features
- Tools: Weather Information
- Resources: System Information
- Prompts: Code Review Templates
- TypeScript: Full type safety and modern JavaScript features
- Logging: Structured logging with configurable levels
- Error Handling: Comprehensive error handling and graceful shutdown
Installation
# Install dependencies
npm install
# Build the project
npm run build
# Start the server
npm start
# Development mode with hot reload
npm run dev
Available Tools
Weather
Get weather information for a location (mock data for demo).
{
"name": "weather",
"arguments": {
"location": "New York, NY"
}
}
Available Resources
System Information
Access current system information and statistics.
- URI:
system://info
- Returns: JSON with system details
Available Prompts
Code Review
Generate comprehensive code review prompts.
{
"name": "code_review",
"arguments": {
"code": "function hello() { console.log('Hello'); }",
"language": "javascript"
}
}
Development
Project Structure
src/
āāā tools/ # MCP tools implementation
āāā resources/ # MCP resources implementation
āāā prompts/ # MCP prompts implementation
āāā types/ # TypeScript type definitions
āāā utils/ # Utility functions
āāā server.ts # Main server class
āāā index.ts # Entry point
Adding New Tools
- Create a new file in
src/tools/
- Define the tool schema and handler
- Export from
src/tools/index.ts
- Add to the server's tool list in
src/server.ts
Environment Variables
LOG_LEVEL
: Set logging level (debug, info, warn, error)
Scripts
npm run build
: Build TypeScript to JavaScriptnpm start
: Start the production servernpm run dev
: Start development server with hot reloadnpm run clean
: Clean build directorynpm run lint
: Run ESLintnpm run lint:fix
: Fix ESLint issues
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Troubleshooting
Common Issues
- Permission Errors: Ensure the server has proper file system permissions
- Port Conflicts: Check if the required ports are available
- Module Not Found: Run
npm install
to install dependencies - TypeScript Errors: Run
npm run build
to check for compilation errors
Debug Mode
Set LOG_LEVEL=debug
to enable detailed logging:
LOG_LEVEL=debug npm start