my-mcp-server

my-mcp-server

A minimal MCP server for task management with a widget-based UI, built using the @miragon/mcp-toolkit.

Category
访问服务器

README

my-mcp-server — minimal @miragon/mcp-toolkit starter

A self-contained starter for an MCP server built on the published @miragon/mcp-toolkit packages: one host (createFrameworkApp), one module that registers its own tools plus a widget (the tasks module), and the Vite setup that builds the widget bundle into a single mcp-app.html. Nothing in here depends on the monorepo.

Two ways to start:

  • Use the template repoMiragon/mcp-toolkit-starter mirrors this directory. Click "Use this template" (or gh repo create my-mcp-server --template Miragon/mcp-toolkit-starter) and you have a fresh repo with CI included.
  • Copy this directory out of the mcp-toolkit repo and rename it.

The included CI (.github/workflows/ci.yml) typechecks and builds the widget bundle. It installs from the restricted @miragon scope: repos in the Miragon org can use the built-in workflow token once the packages grant them read access; anywhere else, add a PACKAGES_READ_TOKEN repo secret (a PAT with read:packages).

Prerequisites

  • Node.js 20 or newer, and pnpm.
  • A GitHub personal access token with the read:packages scope, exported as GITHUB_TOKEN. The packages live on GitHub Packages under the restricted @miragon scope; the .npmrc in this directory is already wired to it.
export GITHUB_TOKEN=ghp_…

Run it

pnpm install
pnpm start          # builds the widget bundle, then boots the host

Then open http://localhost:3010/inspector (the Inspector is built into mcp-use) and call show_tasks_board. That is the full loop: an MCP tool returning a rendered widget.

Optional config lives in .env (copy env.example first):

cp env.example .env

Project layout

├── package.json                   # pinned versions; dev / build:bundle / start / typecheck
├── .npmrc                         # @miragon scope → GitHub Packages
├── env.example                    # PORT / MCP_URL — copy to .env
├── src/
│   ├── host.ts                    # createFrameworkApp: plugins, proxies, app bundle
│   └── modules/tasks/
│       ├── definition.ts          # static contract: module name + widget ids
│       ├── tool-names.ts          # tool-name constants (server ↔ widget agree here)
│       ├── store.ts               # in-memory domain layer; TasksBoardData view-model
│       ├── plugin.ts              # tools: list_tasks, create_task, show_tasks_board, tasks_board_data
│       └── widgets/TaskListCard.tsx  # the widget: {data: TasksBoardData} → UI primitives
└── app-bundle/
    ├── index.html                 # bundle entry + React importmap shim
    ├── main.tsx                   # widget-id map → React components (McpToolkitApp)
    ├── main.css                   # Tailwind entry: globals.css + @source scan paths
    ├── vite.config.ts             # single-file build → app-bundle/dist/index.html
    └── vite-env.d.ts

How the widget bundle works

The host serves one HTML file — mcp-app.html — as an MCP resource (app.resourceUri in src/host.ts). MCP clients render it in an iframe fed from the resource content, so there is no second HTTP request for chunks: the bundle must be a single self-contained file. That is what app-bundle/vite.config.ts produces (vite-plugin-singlefile, everything inlined) into app-bundle/dist/index.html, which htmlPath points at.

Inside the bundle, app-bundle/main.tsx maps widget ids to React components:

  • Every widget is registered twice: once in the plugin's definition.ts (the id + the consumes dataType the server pushes) and once in the bundle's widget map (the id + the component). The two sides meet on the widget id — "tasks:board" here.
  • adaptDataWidget(TaskListCard, "tasks:board") resolves the step whose _dataType is "tasks:board" (set by buildSingleWidgetView in show_tasks_board) and forwards its data to the component's data prop.

The bundle is a build artifact: after changing a widget or the map, rebuild it (pnpm build:bundle) and restart — the host reads the file at app-bundle/dist/index.html. pnpm start chains both.

Styling: app-bundle/main.css imports the toolkit's @miragon/mcp-toolkit-ui/globals.css (Tailwind theme + tokens) and adds two @source lines so Tailwind generates classes used outside the CSS file's own tree — your widgets under src/, and the UI package's shipped sources in node_modules. If a class "does nothing" in the rendered widget, check that the file using it is covered by an @source line.

Where to go next

  • Docs — concepts, guides, and the API reference for every package.
  • The tasks example — the full-size version of this module (complete_task, filterable board widget, in-widget refresh, tests).
  • Agent skills — the repo's coding-agent skills (build-mcp-server, add-mcp-tool, build-mcp-widget, compose-a-view, white-label-client) encode the house patterns; copy them into this project's .claude/skills/ so your coding agent builds on them.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选