本地测试工具 MCP 服务
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"demo-local-mcp-service-01": {
"args": [
"server.py"
],
"command": "python",
"transport": "stdio"
}
}
}
服务介绍
MCP Test Server
Small TypeScript MCP server exposed over Streamable HTTP with a few demo tools for testing clients and transports.
What It Does
- Exposes an MCP endpoint at
POST /mcp - Supports stateful MCP sessions with
mcp-session-id - Supports
GET /mcpas SSE stream for server-initiated notifications - Starts an Express server on port
3000by default - Registers a small set of demo tools for math, text formatting, images, and GitHub API lookups
- Registers notification and event demos for progress, live resource updates, and dynamic catalog changes
- Exposes demo resource and demo prompt in addition to the tools
Included Tools
addNumbers: adds two numbersreverse: reverses a stringformatText: formats text with optional case conversion and style selectionpixelBadge: returns a small SVG badge as image contentgetGitHubRepoStats: fetches star and fork counts for a GitHub repositorygetHilbertHotelInfo: returns generated structured sample datarunProgressDemo: emitsnotifications/progressduring a long-running tool callpushLiveUpdate: updates a live resource and emits resource/logging notificationsstartEventBurst: emits timed server-side events after the tool already returnedtoggleDynamicCatalog: enables or disables demo tool/prompt/resource entries to triggerlist_changednotificationsTEST_valid_json_invalid_mcp_shape: returns HTTP 200 with valid JSON but an invalid MCPtools/callresult shapeTEST_json_response_invalid_json: returns HTTP 200 with invalid JSONTEST_sse_data_invalid_json: returns HTTP 200 as SSE with an invalid JSONdatafield; this test ends with a 60s timeoutTEST_sse_data_invalid_mcp_shape: returns HTTP 200 as SSE with valid JSON but an invalid MCP result shapeTEST_http_500_error: returns HTTP 500 as a negative control for normal HTTP failuresTEST_http_200_empty_body: returns HTTP 200 with an empty response bodyTEST_large_sse_invalid_mcp_shape: returns a large SSE response with valid JSON but an invalid MCP result shape; the diagnostic blob contains exact Pi digitsTEST_long_running_with_progress: runs for configurabledurationSecondswith a default of 75s and emits MCP progress notifications every 5s; clients with a 60s inactivity timeout should not time outTEST_long_running_without_progress: runs for configurabledurationSecondswith a default of 75s without MCP progress notifications; clients with a 60s inactivity timeout should time out
Included Resources
resorcerer: returns a compact markdown overview of the server capabilitieslive-status: returns a JSON snapshot used fornotifications/resources/updatedtestingdynamic-note: optional test resource toggled viatoggleDynamicCatalog
Included Prompts
promptsmith: creates a reusable prompt brief fromgoal,audience, andtoneticket-summary: creates a structured summary for a support ticketdynamic-event-brief: optional prompt toggled viatoggleDynamicCatalog
Tool Screenshots
addNumbers

reverse

formatText

pixelBadge
![]()
getGitHubRepoStats

getHilbertHotelInfo

Events


Requirements
- Node.js 18 or newer
- npm
Install
npm install
Run
npm start
The server listens on:
http://localhost:3000/mcp

Additional deployment:
https://bitfabrik.io/mcp
To use a different port:
PORT=4000 npm start
On Windows PowerShell:
$env:PORT=4000
npm start
Type Check
npm run build
Note: the build script currently runs TypeScript with --noEmit, so it performs type-checking rather than producing output files.
MCP Endpoint
POST /mcp: handles initialization and session-bound MCP requestsGET /mcp: opens the SSE stream for an existing MCP sessionDELETE /mcp: terminates an existing MCP session
Testing Notifications
Recommended test flow for clients that support Streamable HTTP with SSE:
- Initialize with
POST /mcpand capture the returnedmcp-session-idheader. - Open
GET /mcpwith the samemcp-session-idheader to keep the notification stream open. - Call
runProgressDemowith aprogressTokento testnotifications/progress. - Call
pushLiveUpdateorstartEventBurstto testnotifications/messageandnotifications/resources/updated. - Call
toggleDynamicCatalogto testnotifications/resources/list_changed,notifications/prompts/list_changed, andnotifications/tools/list_changed.
Notes:
startEventBurstis useful for out-of-band events because the notifications continue after the tool call response has already been returned.live-statusis the resource that changes when event notifications are emitted.
Example Request
Example JSON-RPC style request body for calling a tool depends on the MCP client you use, but the server endpoint is:
POST http://localhost:3000/mcp
Content-Type: application/json
Additional deployment endpoint:
POST https://bitfabrik.io/mcp
Content-Type: application/json
If you are connecting from an MCP client, configure it to use the Streamable HTTP transport against either URL.
Project Structure
.
├── doc/
│ ├── addnumbers.png
│ ├── cmd.png
│ ├── formattext.png
│ ├── github.png
│ ├── hilbert.png
│ ├── pixelbadge.png
│ └── reverse.png
├── src/
│ └── server.ts
├── package.json
├── tsconfig.json
└── README.md
Notes
- CORS is enabled for any origin
- The MCP server name is
mcp-test-server