Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Leantime MCP BridgeShow me all tasks assigned to me in the Website Redesign project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Leantime MCP Bridge
A robust Model Context Protocol (MCP) proxy bridge for Leantime project management system. Built with TypeScript and the official MCP SDK, this tool provides a reliable bridge between MCP clients and Leantime servers.
โจ Features
Built with Official MCP SDK: Uses
@modelcontextprotocol/sdkfor robust protocol handlingMultiple Authentication Methods: Bearer, API Key, Token, and X-API-Key headers
Protocol Version Support: MCP 2025-03-26 (latest) with backward compatibility
Advanced Transport Support: HTTP/HTTPS, Server-Sent Events (SSE), and streaming responses
TypeScript Implementation: Type-safe, maintainable codebase
Pre-Requisites
If you are self hosted, you need the MCPServer Plugin https://marketplace.leantime.io/product/mcp-server/
Personal access token (or api-key) generated through the Leantime UI
๐ Installation
From npm
From source
๐ Usage
๐ฅ๏ธ Claude Desktop Configuration
Add to your claude_desktop_config.json:
Basic Configuration
For Local Development with Self-Signed Certificates
Using Absolute Path
Production Configuration with Enhanced Security
๐ป Claude Code Configuration
For Claude Code, add to your claude_config.json or use the command line:
Configuration File
Command Line Usage
๐ฏ Cursor Configuration
For Cursor IDE, add to your workspace settings or global settings:
Workspace Settings (.vscode/settings.json)
Global Settings
Open Cursor Settings โ Extensions โ MCP and add:
๐ค OpenAI/ChatGPT Custom GPT Configuration
For ChatGPT with MCP support or OpenAI API integration:
OpenAI API Configuration
Custom GPT Actions Configuration
๐ Universal MCP Client Configuration
For any MCP-compatible client:
Standard MCP Configuration
Docker Configuration
๐ฑ Environment-Specific Examples
Development Environment
Staging Environment
Production Environment
๐ง Command Line Usage
Parameters
<url>- The Leantime MCP endpoint URL (required)--token <token>- Authentication token (required)--auth-method <method>- Authentication method (optional, default: Bearer)--insecure- Skip SSL certificate verification (optional)--protocol-version <version>- MCP protocol version (optional)--max-retries <num>- Maximum retry attempts (optional, default: 3)--retry-delay <ms>- Base retry delay in milliseconds (optional, default: 1000)--no-cache- Disable response caching (optional)
Authentication Methods
Method | Header Format | Example |
|
|
|
|
|
|
Examples
Basic usage with Bearer token
Using API Key authentication
Local development with self-signed certificates
Specific protocol version
High-reliability setup with custom retry settings
Disable caching for development/testing
๐ง How It Works
Protocol Handling: Uses official MCP SDK for robust JSON-RPC message handling
Authentication: Adds appropriate authentication headers based on chosen method
Transport Layer: Supports both regular HTTP responses and Server-Sent Events (SSE)
Error Handling: Comprehensive error handling with proper JSON-RPC error responses
Session Management: Tracks MCP session IDs for stateful interactions
Retry Logic: Exponential backoff with jitter prevents thundering herd problems
Smart Caching: Caches tool/resource/prompt lists to reduce server load
๐ Advanced Features
Retry Logic with Exponential Backoff
Automatic retries: Failed requests are automatically retried (default: 3 attempts)
Exponential backoff: Delay doubles with each retry (1s โ 2s โ 4s...)
Jitter: Random ยฑ25% variation prevents thundering herd effect
Configurable: Customize max retries and base delay via CLI options
Smart Response Caching
Automatic caching:
tools/list,resources/list, andprompts/listresponses are cachedTTL-based expiry: Cached responses expire after 5 minutes
Memory efficient: Automatic cleanup of expired cache entries
Configurable: Use
--no-cacheto disable for development/testing
Production-Ready Reliability
Connection resilience: Handles network interruptions gracefully
Request tracking: Numbered requests for easy debugging
Comprehensive logging: Detailed logs to stderr (won't interfere with MCP communication)
Graceful shutdown: Clean termination on SIGINT/SIGTERM
๐๏ธ Architecture
v2.0 Improvements over v1.x
TypeScript Rewrite: Type-safe implementation with better maintainability
Official SDK Integration: Uses
@modelcontextprotocol/sdkinstead of custom implementationEnhanced Authentication: Support for multiple authentication methods
Better Error Handling: Proper JSON-RPC error responses and logging
Protocol Negotiation: Automatic protocol version negotiation
Streaming Support: Full support for SSE and streaming responses
Protocol Support
Primary: MCP 2025-03-26 (latest specification)
Fallback: MCP 2024-11-05 (backward compatibility)
Auto-negotiation: Automatically detects and uses appropriate protocol version
๐งช Development
Prerequisites
Node.js 18.0.0 or higher
TypeScript 5.4.0 or higher
Access to a Leantime instance with MCP support
Building from Source
Development Mode
๐ก๏ธ Security Considerations
HTTPS Only: Always use HTTPS in production environments
Token Security: Store tokens securely and avoid logging them
SSL Verification: Only use
--insecureflag in developmentToken Rotation: Consider implementing token rotation for long-running processes
Network Security: Ensure proper network security between proxy and Leantime server
๐ Error Handling
The proxy includes comprehensive error handling for:
Network Issues: Connection timeouts, DNS resolution failures
Authentication: Invalid tokens, expired credentials
Protocol Errors: Malformed JSON-RPC messages, protocol mismatches
Server Errors: HTTP errors, invalid responses from Leantime
Transport Issues: SSE connection problems, streaming errors
All error messages are logged to stderr to avoid interfering with MCP communication on stdout.
๐ ๏ธ Troubleshooting
Common Issues and Solutions
"Mcp-Session-Id header required for POST requests"
Fixed in v2.0: The proxy now automatically captures and includes the MCP session ID in all requests after the initial handshake.
"Invalid JSON-RPC response" errors in Claude Desktop
Fixed in v2.0: The proxy now converts PHP error responses from Leantime into proper JSON-RPC error format that Claude Desktop can understand.
Connection keeps dropping/restarting
Check your token: Ensure the Leantime API token is valid and has proper permissions
Network issues: Use
--max-retries 5for unreliable connectionsSSL problems: Use
--insecurefor development with self-signed certificates
Proxy exits immediately without error
This is normal behavior - the proxy waits for JSON-RPC messages from Claude Desktop via stdin. If you're testing manually, send a JSON-RPC message:
"Command not found: leantime-mcp"
Global install: Run
npm install -g .from the project directoryUse absolute path: Reference the compiled script directly in your Claude Desktop config:
"command": "node", "args": ["/absolute/path/to/leantime-mcp/dist/index.js", ...]
Debug Mode
Enable verbose logging to troubleshoot connection issues:
Checking Logs
Claude Desktop logs: Check ~/Library/Logs/Claude/mcp-server-leantime.log (macOS) for detailed MCP communication logs.
Proxy logs: All proxy logs go to stderr and include:
Request/response tracking with numbered IDs
Cache hit/miss information
Retry attempts and backoff timing
Session ID management
Error details and conversions
๐ Logging
The proxy provides detailed logging for debugging:
๐ License
MIT License - see LICENSE file for details
๐ค Contributing
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Make your changes with TypeScript
Add tests if applicable
Build and test (
npm run build && npm test)Submit a pull request
๐ฌ Support
For issues and questions:
Create an issue on GitHub Issues
Check Leantime documentation for MCP setup
Verify your token has proper permissions in Leantime
๐ Changelog
1.6.0 (Latest)
๐ Complete TypeScript rewrite using official MCP SDK
โจ Multiple authentication methods (Bearer, ApiKey, Token, X-API-Key)
๐ Enhanced protocol support (MCP 2025-03-26 + backward compatibility)
๐ง Improved error handling and logging
๐ก Better transport layer with SSE and streaming support
๐ก๏ธ Enhanced security and session management
๐ฆ Smaller codebase (80% reduction) with better maintainability
๐ Advanced retry logic with exponential backoff and jitter
๐พ Smart caching for tool lists and schemas (5-minute TTL)
โก Production-ready connection resilience and error recovery
1.x.x (Legacy)
Basic MCP proxy functionality
HTTP/HTTPS support
Bearer token authentication only
SSL verification bypass option