Fergus MCP Server

Fergus MCP Server

Enables AI assistants to interact with Fergus job management platform through secure API integration. Supports managing jobs, customers, quotes, and sites with real-time data synchronization.

Category
访问服务器

README

Fergus MCP Server

A Model Context Protocol (MCP) server that integrates with the Fergus API, enabling AI assistants like Claude to interact with Fergus's job management platform.

Features

  • 🔐 Secure authentication (PAT for local, OAuth 2.0 for remote)
  • 🌐 Dual transport support: stdio (local CLI) and HTTP (remote web)
  • 📋 26+ tools for jobs, customers, quotes, sites, time entries, and users
  • 🛠️ Create, read, and update Fergus resources
  • 🔄 Real-time data synchronization with Fergus API
  • 💬 Built-in prompts for common workflows

Installation

This server supports two transport modes:

  • Stdio Transport: For local use with Claude Desktop (local mode)
  • HTTP Transport: For remote use with Claude Web or Claude Desktop (remote mode)

Option 1: Local Mode (Stdio) - Claude Desktop

The easiest way to use this MCP server locally with Claude Desktop:

claude mcp add fergus-mcp -- npx -y fergus-mcp --api-token YOUR_API_TOKEN

Or add it manually to your Claude Desktop config:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "fergus": {
      "command": "npx",
      "args": ["-y", "fergus-mcp", "--api-token", "YOUR_API_TOKEN"]
    }
  }
}

Option 2: Remote Mode (HTTP) - Claude Web/Desktop

For remote access (requires hosting the HTTP server):

  1. Host the HTTP server (see Deployment section)
  2. Add as remote server in Claude:
    • Claude will discover OAuth endpoints automatically
    • Authenticate with your Fergus account via OAuth
    • No manual token configuration needed!

Local Development

  1. Clone this repository

  2. Install dependencies:

    pnpm install
    
  3. Build the project:

    pnpm run build
    
  4. Run in development mode:

    Stdio mode (for testing with local MCP clients):

    pnpm run dev -- --api-token YOUR_API_TOKEN
    

    HTTP mode (for testing remote server):

    # Create .env file with OAuth credentials
    cp .env.example .env
    # Edit .env with your configuration
    pnpm run dev:http
    

Configuration

Stdio Mode (Local)

Personal Access Token (PAT) is required. Get yours from your Fergus account settings.

Option 1: Command-line argument (Recommended)

npx fergus-mcp --api-token YOUR_API_TOKEN

Option 2: Environment variable

Create a .env file:

FERGUS_API_TOKEN=your_fergus_api_token_here

HTTP Mode (Remote)

OAuth 2.0 credentials are required. Configure in .env:

# Required OAuth Configuration
COGNITO_USER_POOL_ID=us-east-1-xxxxx
COGNITO_CLIENT_ID=your_client_id
COGNITO_CLIENT_SECRET=your_client_secret
COGNITO_REGION=us-east-1
COGNITO_DOMAIN=auth.fergus.com
OAUTH_REDIRECT_URI=https://your-domain.com/oauth/callback

# Server Configuration
HTTP_PORT=3100
PUBLIC_URL=https://your-domain.com

See .env.example for complete configuration options.

Optional Configuration

  • --base-url: Override the default Fergus API base URL
  • FERGUS_BASE_URL: Environment variable for base URL

Available Tools

This server provides 26+ tools organized by resource type:

Jobs (5 tools)

  • get-job: Get details for a specific job by ID
  • list-jobs: List all jobs with filtering and sorting
  • create-job: Create a new job (draft or finalized)
  • update-job: Update existing draft job
  • finalize-job: Convert draft job to active status

Quotes (7 tools)

  • get-quote: Get basic quote information
  • get-quote-detail: Get comprehensive quote with sections and line items
  • list-quotes: List quotes with filtering
  • create-quote: Create quote with sections and line items
  • update-quote: Update draft quote sections (by quote ID)
  • update-quote-version: Update draft quote sections (by version number)

Customers (3 tools)

  • get-customer: Get customer details
  • list-customers: List customers with search
  • create-customer: Add new customer
  • update-customer: Modify customer details

Sites (3 tools)

  • get-site: Get site details
  • list-sites: List sites with filtering
  • create-site: Add new site
  • update-site: Modify site details

Users (3 tools)

  • get-user: Get user/team member details
  • list-users: List users with filtering
  • update-user: Update user details

Time Entries (2 tools)

  • get-time-entry: Get time entry details
  • list-time-entries: List time entries with filtering

Built-in Prompts (3)

  • job-creation-assistant: Guided workflow for creating jobs
  • quote-generator: Help creating comprehensive quotes
  • weekly-report: Generate job status summaries

Usage Examples

Once connected, you can ask Claude:

  • "Show me all active jobs in Fergus"
  • "Create a quote for job #12345"
  • "List all customers in Auckland"
  • "Update the address for site #456"
  • "Show me this week's time entries"
  • "Create a new job for ABC Corp at their main office"

Development

Project Structure

fergus-mcp/
├── src/
│   ├── index.ts              # Main server entry point
│   ├── config.ts             # Configuration management
│   ├── fergus-client.ts      # Fergus API client wrapper
│   ├── resources/            # MCP resource handlers
│   └── tools/                # MCP tool handlers
├── package.json
├── tsconfig.json
└── README.md

Building

pnpm run build

Running in Dev Mode

Stdio mode:

pnpm run dev -- --api-token YOUR_API_TOKEN

HTTP mode:

pnpm run dev:http

Scripts

  • pnpm run build - Build the project
  • pnpm run dev - Run stdio server in development mode
  • pnpm run dev:http - Run HTTP server in development mode
  • pnpm start - Run built stdio server
  • pnpm start:http - Run built HTTP server

Deployment

Quick Deploy to Render (Recommended)

This server is ready to deploy to Render with Redis session storage:

  1. Fork or clone this repository to your GitHub account
  2. Create a new Blueprint on Render and connect your repository
  3. Configure OAuth credentials in Render Dashboard (see DEPLOYMENT.md)
  4. Deploy! Render will automatically provision:
    • Node.js web service
    • Redis instance for sessions
    • SSL certificate
    • Internal networking

See DEPLOYMENT.md for complete step-by-step instructions.

Other Hosting Providers

The server can also be deployed to:

  • Cloudflare Workers: Use Durable Objects for session storage
  • Vercel: Configure Redis via Vercel KV
  • Railway: Similar to Render, uses render.yaml
  • AWS/GCP/Azure: Deploy as containerized app with managed Redis

See .env.example for required environment variables.

Security

Stdio Mode (Local)

  • Never commit your Personal Access Token to version control
  • Use environment variables or CLI arguments for configuration
  • Server runs locally and communicates directly with Fergus API

HTTP Mode (Remote)

  • OAuth 2.0 with PKCE for secure authentication
  • Tokens stored in-memory (optionally Redis for multi-instance deployments)
  • HTTPS required in production
  • CORS and DNS rebinding protection enabled
  • Session-based token management with automatic refresh
  • No data stored or transmitted to third parties

License

MIT

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Support

For issues and questions:

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选