tekionai-mcp-client

v1.4.13
@deepakd/tekionai-mcp-client Checked 4 hours ago Published 1 year ago

Tekion AI MCP Client - Local Jira and GitLab tools with remote server integration

A simple stdio-based Model Context Protocol (MCP) server that provides local Jira and GitLab tools while integrating with a remote MCP server. The Tekion MCP Client provides: - Local Jira Tools: All Jira operations execute locally for better performance and credential security - Local GitLab Tools: GitLab operations using glab CLI for merge request management - Remote Server Integration: Forwards other tools to the remote MCP server - Stdio Interface: Simple stdio transport for direct MCP client connection - Intelligent Routing: Automatically routes tools between local and remote execution -…

Summary extracted from the README.

Tekion AI MCP Client

A simple stdio-based Model Context Protocol (MCP) server that provides local Jira and GitLab tools while integrating with a remote MCP server.

Overview

The Tekion MCP Client provides:

  • Local Jira Tools: All Jira operations execute locally for better performance and credential security
  • Local GitLab Tools: GitLab operations using glab CLI for merge request management
  • Remote Server Integration: Forwards other tools to the remote MCP server
  • Stdio Interface: Simple stdio transport for direct MCP client connection
  • Intelligent Routing: Automatically routes tools between local and remote execution
  • Connection Management: Handles remote server connectivity with retry logic

Architecture

[AI Client] ↔ [Tekion MCP Client via stdio] ↔ [Remote MCP Server]
                      ↓
                [Local Jira Tools]
                [Local GitLab Tools]

Features

Local Jira Tools

  • get_jira_ticket - Retrieve JIRA ticket information
  • create_jira_ticket - Create new JIRA tickets
  • create_jira_epic - Create JIRA epics
  • add_jira_comment - Add comments to tickets
  • link_jira_epic_to_parent - Link epics to parent tickets
  • link_jira_story_to_parent - Link stories to parent tickets
  • update_jira_ticket - Update existing tickets
  • attach_file_to_jira - Attach files to tickets

Local GitLab Tools

  • get_gitlab_prs - Get open merge requests for a GitLab project (requires glab CLI)
  • save_generated_context - Save generated context files to TekionAI repository via branch and PR (requires glab CLI and git)

Proxy Features

  • Automatic tool routing (local vs remote)
  • Connection health monitoring
  • Retry logic with exponential backoff
  • Graceful degradation when remote server unavailable
  • Real-time tool discovery from remote server

Prerequisites

GitLab CLI (for GitLab tools)

Install and authenticate the GitLab CLI:

# Install glab CLI
# macOS
brew install glab

# Linux/Windows - see https://gitlab.com/gitlab-org/cli

# Authenticate
glab auth login

Installation

npx @tekionai/mcp-client

Option 2: Local Development

  1. Clone and setup:

    cd mcp-client
    npm install
    
  2. Configure environment:

    cp .env.example .env
    # Edit .env with your configuration
    
  3. Build the project:

    npm run build
    

Configuration

Environment Variables

Variable Description Default Required
REMOTE_MCP_SERVER_URL Remote MCP server URL http://localhost:8085/mcp No
TEKIONAI_FRAMEWORK_TYPE Environment type (DEV/QA) DEV No
TEKIONAI_MODULE Module name for remote server - No
TEKION_EMAIL Jira email (local use only) - Yes*
JIRA_TOKEN Jira API token (local use only) - Yes*
JIRA_BASE_URL Jira base URL https://tekion.atlassian.net No

*Required for local Jira tools to function. NOT sent to remote server.

Example Configuration

# Remote server
REMOTE_MCP_SERVER_URL=http://your-remote-server:8085/mcp
TEKIONAI_FRAMEWORK_TYPE=DEV
TEKIONAI_MODULE=aec-studio

# Local Jira credentials (NOT sent to remote server)
TEKION_EMAIL=your-email@tekion.com
JIRA_TOKEN=your-jira-api-token

Usage

Starting the Proxy

# Development mode
npm run dev

# Production mode
npm run build
npm start

Connecting AI Clients

Configure your AI client to use the Tekion MCP Client:

{
  "mcpServers": {
    "tekion": {
      "command": "npx",
      "args": ["@tekionai/mcp-client"],
      "env": {
        "TEKION_EMAIL": "your-email@tekion.com",
        "JIRA_TOKEN": "your-jira-token",
        "REMOTE_MCP_SERVER_URL": "http://your-remote-server:8085/mcp"
      }
    }
  }
}

Using local build

{
  "mcpServers": {
    "tekion": {
      "command": "node",
      "args": ["path/to/mcp-client/dist/index.js"],
      "env": {
        "TEKION_EMAIL": "your-email@tekion.com",
        "JIRA_TOKEN": "your-jira-token",
        "REMOTE_MCP_SERVER_URL": "http://your-remote-server:8085/mcp"
      }
    }
  }
}

Testing the Connection

Use any MCP client to test:

# Test with npx
npx @tekionai/mcp-client

# Test local build
node dist/index.js

Tool Routing Logic

The proxy uses intelligent routing to determine where to execute tools:

  1. Local Jira Tools: Always executed locally for performance and security
  2. Local Tools: Tools registered locally take precedence
  3. Remote Tools: Tools not available locally are forwarded to remote server
  4. Fallback: If remote server unavailable, returns appropriate error

Error Handling

Remote Server Unavailable

  • Local Jira tools continue to work
  • Remote tools return connection error
  • Automatic reconnection attempts with exponential backoff

Jira Credential Issues

  • Clear error messages for missing credentials
  • Tools fail gracefully with helpful error information

Network Issues

  • Connection retry logic (up to 3 attempts)
  • Exponential backoff between retries
  • Health check monitoring

Development

Project Structure

src/
├── client.ts              # Main proxy server
├── config.ts              # Configuration management
├── types/                 # TypeScript type definitions
├── proxy/
│   ├── remoteClient.ts    # Remote MCP server client
│   └── toolRouter.ts      # Tool routing logic
└── tools/
    ├── jira/              # Local Jira tools
    │   ├── index.ts
    │   ├── jiraIntegration.ts
    │   └── *.ts           # Individual tool implementations
    └── gitlab/            # Local GitLab tools
        ├── index.ts
        └── *.ts           # Individual tool implementations

Adding New Local Tools

  1. Create tool implementation in appropriate directory
  2. Export from index file
  3. Register in client.ts

Scripts

npm run build      # Build TypeScript
npm run dev        # Development mode with hot reload
npm start          # Start production server
npm run lint       # Run ESLint
npm run format     # Format code with Prettier

Troubleshooting

Common Issues

  1. Remote server connection fails

    • Check REMOTE_MCP_SERVER_URL configuration
    • Verify remote server is running and accessible
    • Check network connectivity
  2. Jira tools not working

    • Verify TEKION_EMAIL and JIRA_TOKEN are set
    • Test Jira credentials manually
    • Check Jira API token permissions
  3. Tools not appearing

    • Check proxy startup logs for registration errors
    • Verify remote server tool discovery
    • Check health endpoint for status

Logs

The proxy provides detailed logging:

  • Tool registration
  • Routing decisions
  • Remote server connectivity
  • Error details

Set LOG_LEVEL=debug for verbose logging.

License

MIT License - see LICENSE file for details.