An MCP proxy bridge for the Leantime project management system, forwarding JSON-RPC messages with proper authentication.
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.
@modelcontextprotocol/sdk
for robust protocol handlingnpm install -g leantime-mcp
git clone https://github.com/leantime/leantime-mcp.git
cd leantime-mcp
npm install
npm run build
npm install -g .
Add to your claude_desktop_config.json
:
{
"mcpServers": {
"leantime": {
"command": "leantime-mcp",
"args": [
"https://yourworkspace.leantime.io/mcp",
"--token",
"YOUR_TOKEN_HERE"
]
}
}
}
{
"mcpServers": {
"leantime": {
"command": "leantime-mcp",
"args": [
"https://yourworkspace.leantime.io/mcp",
"--token",
"YOUR_TOKEN_HERE",
"--insecure"
]
}
}
}
{
"mcpServers": {
"leantime": {
"command": "node",
"args": [
"/path/to/leantime-mcp/dist/index.js",
"https://your-leantime.com/mcp",
"--token",
"YOUR_TOKEN_HERE"
]
}
}
}
{
"mcpServers": {
"leantime": {
"command": "leantime-mcp",
"args": [
"https://yourworkspace.leantime.io/mcp",
"--token",
"YOUR_TOKEN_HERE",
"--auth-method",
"Bearer",
"--max-retries",
"5",
"--retry-delay",
"2000"
]
}
}
}
For Claude Code, add to your claude_config.json
or use the command line:
{
"mcp": {
"servers": {
"leantime": {
"command": "leantime-mcp",
"args": [
"https://yourworkspace.leantime.io/mcp",
"--token",
"YOUR_TOKEN_HERE"
]
}
}
}
}
claude --mcp-server leantime="leantime-mcp https://your-leantime.com/mcp --token YOUR_TOKEN_HERE"
For Cursor IDE, add to your workspace settings or global settings:
.vscode/settings.json
){
"mcp.servers": {
"leantime": {
"command": "leantime-mcp",
"args": [
"https://yourworkspace.leantime.io/mcp",
"--token",
"YOUR_TOKEN_HERE"
]
}
}
}
Open Cursor Settings โ Extensions โ MCP and add:
{
"leantime": {
"command": "leantime-mcp",
"args": [
"https://yourworkspace.leantime.io/mcp",
"--token",
"YOUR_TOKEN_HERE"
]
}
}
For ChatGPT with MCP support or OpenAI API integration:
# Python example using OpenAI with MCP
import openai
from mcp_client import MCPClient
# Initialize MCP client
mcp_client = MCPClient(
command="leantime-mcp",
args=[
"https://yourworkspace.leantime.io/mcp",
"--token",
"YOUR_TOKEN_HERE"
]
)
# Use with OpenAI
client = openai.OpenAI(api_key="your-openai-key")
response = client.chat.completions.create(
model="gpt-4",
messages=[{"role": "user", "content": "Show me my Leantime projects"}],
tools=mcp_client.get_tools()
)
# For Custom GPT Actions
openapi: 3.0.0
info:
title: Leantime MCP Proxy
version: 2.0.0
servers:
- url: https://yourworkspace.leantime.io/mcp
paths:
/tools/list:
post:
summary: List available tools
requestBody:
content:
application/json:
schema:
type: object
properties:
jsonrpc:
type: string
default: "2.0"
method:
type: string
default: "tools/list"
id:
type: integer
security:
- bearerAuth: []
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
For any MCP-compatible client:
{
"name": "leantime",
"command": "leantime-mcp",
"args": [
"https://yourworkspace.leantime.io/mcp",
"--token",
"YOUR_TOKEN_HERE"
],
"env": {
"NODE_ENV": "production"
}
}
# docker-compose.yml
version: '3.8'
services:
leantime-mcp:
image: node:18-alpine
command: npx leantime-mcp https://yourworkspace.leantime.io/mcp --token YOUR_TOKEN_HERE
environment:
- NODE_ENV=production
volumes:
- ./config:/config
stdin_open: true
tty: true
# Local testing with debug logging
leantime-mcp https://localhost:8080/mcp \
--token "dev-token-123" \
--insecure \
--no-cache \
--max-retries 1 \
2>debug.log
# Staging with moderate reliability
leantime-mcp https://staging.leantime.com/mcp \
--token "staging-token-456" \
--max-retries 3 \
--retry-delay 1000
# Production with high reliability
leantime-mcp https://leantime.company.com/mcp \
--token "prod-token-789" \
--auth-method Bearer \
--max-retries 5 \
--retry-delay 2000
leantime-mcp <url> --token <token> [options]
<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)Method | Header Format | Example |
---|---|---|
Bearer (default) | Authorization: Bearer <token> | --auth-method Bearer |
X-API-Key | X-API-Key: <token> | --auth-method X-API-Key |
leantime-mcp https://leantime.example.com/mcp --token abc123
leantime-mcp https://leantime.example.com/mcp --token abc123 --auth-method ApiKey
leantime-mcp https://localhost/mcp --token abc123 --insecure
leantime-mcp https://leantime.example.com/mcp --token abc123 --protocol-version 2025-03-26
leantime-mcp https://leantime.example.com/mcp --token abc123 --max-retries 5 --retry-delay 2000
leantime-mcp https://leantime.example.com/mcp --token abc123 --no-cache
tools/list
, resources/list
, and prompts/list
responses are cached--no-cache
to disable for development/testing@modelcontextprotocol/sdk
instead of custom implementation# Clone the repository
git clone https://github.com/leantime/leantime-mcp.git
cd leantime-mcp
# Install dependencies
npm install
# Build TypeScript
npm run build
# Test locally
echo '{"jsonrpc":"2.0","id":1,"method":"ping"}' | node dist/index.js https://your-leantime.com/mcp --token your-token
# Watch for changes and rebuild
npm run dev
--insecure
flag in developmentThe proxy includes comprehensive error handling for:
All error messages are logged to stderr
to avoid interfering with MCP communication on stdout
.
Fixed in v2.0: The proxy now automatically captures and includes the MCP session ID in all requests after the initial handshake.
Fixed in v2.0: The proxy now converts PHP error responses from Leantime into proper JSON-RPC error format that Claude Desktop can understand.
--max-retries 5
for unreliable connections--insecure
for development with self-signed certificatesThis 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:
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | leantime-mcp https://your-leantime.com/mcp --token YOUR_TOKEN
npm install -g .
from the project directory"command": "node",
"args": ["/absolute/path/to/leantime-mcp/dist/index.js", ...]
Enable verbose logging to troubleshoot connection issues:
# The proxy logs to stderr, so you can see debug info while MCP communication continues
leantime-mcp https://your-leantime.com/mcp --token YOUR_TOKEN 2>debug.log
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:
The proxy provides detailed logging for debugging:
[LeantimeMCP] Initializing Leantime MCP Proxy...
[LeantimeMCP] Server: https://leantime.example.com/mcp
[LeantimeMCP] Auth Method: Bearer
[LeantimeMCP] SSL verification: enabled
[LeantimeMCP] Protocol version: 2025-03-26
[LeantimeMCP] Ready to handle MCP requests...
MIT License - see LICENSE file for details
git checkout -b feature/amazing-feature
)npm run build && npm test
)For issues and questions:
Contract and template management for drafting, reviewing, and sending binding contracts.
A simple note storage system that allows adding and summarizing notes using a custom URI scheme.
Interact with task, doc, and project data in Dart, an AI-native project management tool
An MCP Server Integration with Apple Shortcuts
Interact with your Obsidian vault using natural language.
Automates marketing operations with AI-powered optimization, real-time analytics, and multi-platform integration.
An intelligent tutoring server that uses GitHub documentation repositories to provide structured educational prompts and tools.
A server for interacting with the Hyperweb platform and its tools using AI agents.
Parses invoice data, uploads it to Google Sheets, and answers queries by fetching information from the sheet.
Full implementation of Todoist Rest API for MCP server