NowhereLabs/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 TypeScript MCP server that integrates a Rust-based screenshot tool, providing a comprehensive solution for website screenshot capture.
take_screenshot
Capture a screenshot of a single URL with various options.
take_batch_screenshots
Capture screenshots of multiple URLs concurrently.
health_check
Check the health status of the screenshot tool.
Rust MCP Server with Real-time Dashboard
A high-performance Model Context Protocol (MCP) server implementation in Rust with an integrated real-time web dashboard for monitoring and debugging.
Features
- MCP Protocol Implementation: Built with the official MCP SDK for Claude Desktop integration
- Real-time Web Dashboard: Monitor server status, tool executions, and metrics via WebSocket
- Flexible Operation Modes: Run MCP server only, dashboard only, or both together
- High-Performance Architecture: Lock-free concurrent data structures for optimal throughput
- Alpine.js Frontend: Reactive UI components with Tailwind CSS styling
- Docker Support: Production-ready containerization with multi-stage builds
Quick Start
Prerequisites
- Rust 1.82+ (for local development)
- Node.js 20+ (for building frontend assets)
- Docker & Docker Compose (for containerized deployment)
Installation Options
Using GitHub Packages Docker Image
# Pull the latest image
docker pull ghcr.io/nowherelabs/rust-mcp-server:latest
# Run with docker-compose
docker run -p 8080:8080 ghcr.io/nowherelabs/rust-mcp-server:latest
# Or use a specific version
docker pull ghcr.io/nowherelabs/rust-mcp-server:v0.1.1
Building from Source
# Build and run with docker-compose
docker-compose -f docker/docker-compose.yml up --build
# Or use the build script
./docker/build-docker.sh
# Access the dashboard at http://localhost:8080
Running Locally
# Install dependencies and build everything
./scripts/build.sh
# Or build components separately:
npm install
npm run build-css
npm run build-js:prod
cargo build --release
# Run the server (defaults to both MCP and dashboard)
cargo run --release
# Run specific modes
cargo run --release -- --mode=mcp-only # MCP server only
cargo run --release -- --mode=dashboard # Dashboard only
cargo run --release -- --mode=both # Both (default)
# Access the dashboard at http://localhost:8080
Project Structure
.
āāā config/ # Configuration files
ā āāā tailwind.config.js
ā āāā postcss.config.js
ā āāā vitest.config.js
ā āāā esbuild.config.js
ā āāā rustfmt.toml
ā āāā clippy.toml
āāā docker/ # Docker deployment files
ā āāā Dockerfile
ā āāā docker-compose.yml
ā āāā nginx.conf
ā āāā build-docker.sh
āāā docs/ # Documentation
ā āāā CLAUDE.md # Claude Code instructions
ā āāā DOCKER.md # Docker deployment guide
āāā scripts/ # Build and utility scripts
ā āāā build.sh
ā āāā build.js
āāā src/ # Rust source code
ā āāā main.rs # Application entry point
ā āāā shared/ # Shared state and configuration
ā ā āāā state.rs # Thread-safe AppState
ā ā āāā config.rs # Environment configuration
ā āāā server/ # MCP protocol implementation
ā ā āāā mod.rs # MCP server setup
ā ā āāā mcp_router.rs # Tool routing
ā ā āāā echo_test.rs # Example echo tool
ā ā āāā error.rs # Error types
ā āāā dashboard/ # Web interface
ā āāā server.rs # Actix Web server
ā āāā handlers.rs # REST API endpoints
ā āāā websocket.rs # Real-time WebSocket
āāā static/ # Frontend assets
ā āāā css/ # Tailwind input/output
ā āāā js/ # Alpine.js components
āāā templates/ # Askama HTML templates
āāā tests/ # Test suites
āāā integration_tests.rs
āāā dashboard_tests.rs
āāā components/ # JavaScript tests
Currently Implemented Tools
The server currently implements an example "echo" tool for testing. To add new tools:
- Create a tool handler in
src/server/
- Register it in
mcp_router.rs
- Add tests for the new functionality
Architecture Highlights
State Management
- ArcSwap: Lock-free reads for frequently accessed data (MCP status)
- DashMap: Concurrent HashMap for session management
- RwLock: For append-heavy collections (tool call history)
- Broadcast Channels: Real-time event distribution to dashboard
Frontend Stack
- Tailwind CSS: Utility-first styling
- Alpine.js: Lightweight reactive components
- ESBuild: Fast JavaScript bundling
- Vitest: Component testing framework
Development
Testing
# Run all Rust tests
cargo test
# Run specific test suites
cargo test --test integration_tests
cargo test --test dashboard_tests
# Run JavaScript tests
npm test
npm run test:ui # With UI
npm run test:coverage # With coverage
# Run tests with output
cargo test -- --nocapture
Code Quality
# Format code
cargo fmt
# Run linter (strict mode)
cargo clippy -- -D warnings
# Check for vulnerabilities
cargo audit
# Run all checks
cargo fmt && cargo clippy -- -D warnings && cargo test
Development Mode
The server includes hot-reload functionality for rapid development:
# Start with hot-reload (recommended)
./scripts/dev.sh # Dashboard only
./scripts/dev-both.sh # MCP + Dashboard
# Or manually with --dev flag
cargo run -- --dev
# Features in dev mode:
# - Automatic browser refresh on frontend changes
# - Auto-compilation on backend changes (with cargo-watch)
# - Visual "DEV MODE" indicator in UI
# - File watching for templates, CSS, JS, and Rust code
# Traditional development commands
npm run watch-css # Watch CSS changes
# Build JavaScript with sourcemaps
npm run build-js:dev
# Run with debug logging
RUST_LOG=debug cargo run
Configuration
Key environment variables:
RUST_LOG
: Logging level (default:info
)DASHBOARD_HOST
: Dashboard bind address (default:127.0.0.1
)DASHBOARD_PORT
: Dashboard port (default:8080
)ENABLE_CORS
: Enable CORS for development (default:false
)
Claude Desktop Integration
Add to your Claude Desktop configuration:
{
"mcpServers": {
"rust-mcp-dashboard": {
"command": "cargo",
"args": ["run", "--release"],
"cwd": "/path/to/rust-mcp-server"
}
}
}
Security Features
- Content Security Policy headers
- Input validation on all endpoints
- Non-root Docker execution
- Structured error handling without information leakage
Performance
The server is designed for high concurrency with:
- Lock-free data structures where possible
- Efficient state management patterns
- Automatic cleanup of old data (tool history limited to 1000 entries)
- WebSocket connection pooling
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please ensure:
- All tests pass (
cargo test
) - Code is formatted (
cargo fmt
) - No clippy warnings (
cargo clippy -- -D warnings
) - New features include tests