Skip to main content
Glama
bhargavlukka

TicketDesk MCP

by bhargavlukka

TicketDesk MCP — 生产级 MCP 服务器与客户端

一个基于模型上下文协议(Model Context Protocol,MCP)的服务器,暴露内部支持工单队列,并搭配一个可发现并调用其工具、资源和提示词的客户端。本项目为“构建生产级 MCP 服务器与客户端”实验(模块 4,模型上下文协议)而构建。

目录

Related MCP server: TicketAI

架构

flowchart TD
    HOST["Host application\n(e.g. an AI assistant / chatbot)"] --> CLIENT

    subgraph Client["client.py — fastmcp.Client"]
        CLIENT["Discovery: list_tools / list_resources /\nlist_resource_templates / list_prompts"]
        ELICIT["elicitation_handler\n(client-side safety gate for\nhigh-impact actions)"]
        CLIENT <--> ELICIT
    end

    CLIENT <-->|"Streamable HTTP\nAuthorization: Bearer <token>"| SERVER

    subgraph Server["server.py — FastMCP('TicketDesk')"]
        AUTH["StaticTokenVerifier\n(read:tickets / write:tickets scopes)"]
        TOOLS["Tools: search_tickets, get_ticket,\nadd_ticket_note, close_ticket"]
        RES["Resources: ticket://{ticket_id},\npolicy://sla"]
        PROMPT["Prompt: triage_ticket"]
        AUTH --> TOOLS
        AUTH --> RES
        AUTH --> PROMPT
    end

    SERVER --> DATA[("data/tickets.json,\ndata/sla_policy.md")]

传输方式:Streamable HTTP —— 详细说明见 docs/architecture.md (简而言之:它设计为可供多个团队的 AI 应用连接的一个共享内部能力,而非一队本地进程,而那才是 stdio 所适合的)。

服务器暴露了什么

  • 4 个工具search_ticketsget_ticketadd_ticket_noteclose_ticket(最后一个是通过客户端侧引导把关的高影响操作)

  • 2 个资源ticket://{ticket_id}(模板化)和 policy://sla(静态)

  • 1 个提示词triage_ticket

各项的完整文档:docs/tools-resources-prompts.md

设置与运行演示

pip install -r requirements.txt

# Terminal 1
python server.py

# Terminal 2
python client.py                # interactive: real confirmation prompts via input()
python client.py --auto-confirm # non-interactive demo mode (used to produce demo/session_log.txt)

client.py 使用 dev-agent-token(读 + 写作用域)建立连接,运行发现,逐一调用每种工具/资源/提示词,演示两种错误处理失败模式(需求 8),通过客户端侧引导执行高影响的 close_ticket 操作(需求 6),并以最小权限演示收尾,展示 dev-readonly-token 被拒绝访问写作用域工具。

安全

完整内容:docs/security-summary.md。简略版:通过 StaticTokenVerifier 进行 bearer-token 身份验证,显式的逐工具作用域检查(一个真实缺口 —— 仅凭连接级作用域要求并 不能 限制单个工具调用 —— 在开发期间被发现并修复;完整经过见安全文档),以及 ToolError + mask_error_details=True 来区分用户可处理的错误与绝不应原样到达客户端的内部故障。

需求映射

需求

满足位置

≥3 个工具

search_ticketsget_ticketadd_ticket_noteclose_ticketserver.py

≥2 个资源,每个均为 URI

ticket://{ticket_id}policy://slaserver.py

≥1 个可复用提示词

triage_ticketserver.py

客户端发现并调用每一项

client.py run_discovery_and_demo()

传输方式选择明确说明

docs/architecture.md

客户端侧安全特性

把关 close_ticket 的引导确认(client.py elicitation_handler

安全设计摘要

docs/security-summary.md

针对真实失败模式的错误处理

无效工单 ID(ToolError)+ 模拟后端存储中断(mask_error_details)—— 均在 server.py 中,并在 client.py 中演示

演示日志

demo/session_log.txt(真实捕获的运行记录)

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Manage SRG+ hubs, channels, content, assets, users, and workspaces from any MCP-aware AI agent.

  • AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.

  • Phone, SMS & email for AI agents — one remote MCP endpoint, OAuth login, zero install.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bhargavlukka/ticketdesk-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server