MCP Communication Server
Used for package management and running scripts to build and start the MCP server, as shown in the installation and startup commands.
The MCP server is built with TypeScript, requiring compilation before running, with configuration specified in tsconfig.json.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Communication Serverlist all active WebSocket connections"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP 通信服务器
一个支持页面与客户端数据通信的MCP (Model Context Protocol) 服务器实现。
🏗️ 架构设计
本项目采用分离式架构设计:
MCP 服务器 (
src/index.ts) - 纯粹的MCP协议服务器,提供工具和资源Web 服务器 (
src/web-server.ts) - 独立的HTTP/WebSocket服务器,处理静态文件和实时通信
Related MCP server: Figma MCP Server
📦 安装依赖
npm install🚀 启动服务
方式1:分别启动(推荐用于开发)
# 编译TypeScript代码
npm run build
# 启动Web服务器 (端口3001)
npm run start:web
# 启动MCP服务器 (在另一个终端)
npm run start方式2:同时启动两个服务
npm run build
npm run start:both方式3:只启动Web服务器
npm run build
npm run start:web🌐 访问地址
启动Web服务器后,可以通过以下URL访问:
主页:
http://localhost:3001/测试页面:
http://localhost:3001/test-page.html服务器状态:
http://localhost:3001/api/status连接列表:
http://localhost:3001/api/connections
🛠️ MCP 工具
MCP服务器提供以下工具:
1. open_web_page
功能: 在浏览器中打开指定URL
参数:
url(string) - 要打开的网页地址示例:
open_web_page("http://localhost:3001/test-page.html")
2. list_connections
功能: 列出所有活跃的WebSocket连接
参数: 无
返回: 当前所有连接ID列表
3. get_page_data
功能: 获取页面发送的数据
参数:
connectionId(可选) - 指定连接ID,不提供则返回所有数据返回: 页面数据的JSON格式
4. send_to_page
功能: 向指定页面发送消息
参数:
connectionId(string) - 目标连接IDmessage(any) - 要发送的消息内容
🔄 通信流程
建立连接:网页通过WebSocket连接到
ws://localhost:3001获取连接ID:服务器自动分配唯一连接ID
发送数据:网页发送数据到服务器(如页面状态、用户输入等)
MCP交互:通过MCP工具获取数据或发送指令
实时通信:支持双向实时数据交换
📝 消息格式
页面发送到服务器
{
"type": "page_data",
"data": {
"page": "test",
"user_input": "Hello World",
"timestamp": "2024-01-01T00:00:00Z"
}
}服务器发送到页面
{
"type": "mcp_message",
"message": {
"command": "update_ui",
"data": "Some data from MCP client"
},
"timestamp": "2024-01-01T00:00:00Z"
}🔧 开发
监听模式开发
# 在一个终端启动TypeScript监听编译
npm run dev
# 在另一个终端启动Web服务器
npm run start:web
# MCP服务器需要手动重启来加载新代码
npm run start添加新的MCP工具
在 src/index.ts 中使用 server.registerTool() 添加新工具。
扩展Web API
在 src/web-server.ts 中添加新的HTTP端点或WebSocket消息处理逻辑。
📁 项目结构
mcp/
├── src/
│ ├── index.ts # MCP服务器
│ └── web-server.ts # Web服务器
├── test-page.html # 测试页面
├── package.json # 项目配置
├── tsconfig.json # TypeScript配置
└── README.md # 说明文档💡 使用场景
网页与AI助手的实时数据交换
浏览器插件与MCP客户端通信
在线工具与外部服务集成
实时协作应用开发
⚠️ 注意事项
确保防火墙允许3001端口访问
在生产环境中需要配置HTTPS和WSS
考虑添加身份验证和授权机制
监控WebSocket连接数量,避免资源泄露
Available Tools
2 toolsaddAddition ToolC
Add two numbers
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. The description 'Add two numbers' reveals nothing about behavioral traits such as error handling, performance characteristics, side effects, or return format. It's a minimal statement that doesn't add any context beyond the basic operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with a single sentence 'Add two numbers' that directly states the purpose without any waste. It's front-loaded and appropriately sized for a simple tool, though this conciseness comes at the cost of completeness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (2 parameters, no annotations, no output schema), the description is incomplete. It doesn't cover behavioral aspects, parameter semantics, or usage guidelines. While the operation is straightforward, the description lacks necessary context for an AI agent to understand how to invoke it effectively beyond the basic schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 0%, meaning the input schema provides no descriptions for parameters 'a' and 'b'. The description 'Add two numbers' adds no meaning beyond what the schema already implies from property names and types. It doesn't explain what 'a' and 'b' represent, their constraints, or usage examples.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Add two numbers' clearly states the tool's purpose with a specific verb ('Add') and resource ('two numbers'). It's unambiguous about what the tool does, though it doesn't explicitly distinguish from the sibling tool 'open_web_page' since they serve completely different domains (mathematics vs. web navigation).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention any context, prerequisites, or exclusions for usage. The sibling tool 'open_web_page' is unrelated, so no comparison is needed, but there's still no usage context provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
open_web_page打开网页A
在IDE中打开一个新的网页窗口显示指定的URL,并自动等待接收页面发送的WebSocket数据
| Name | Required | Description | Default |
|---|---|---|---|
| timeoutMs | No | 等待数据的超时时间(毫秒),默认10秒 | |
| url | Yes | ||
| waitForData | No | 是否等待页面发送数据,默认为true |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden and partially succeeds. It discloses that the tool opens a web page in an IDE and waits for WebSocket data, which are key behavioral traits. However, it doesn't mention potential side effects, error conditions, or what happens after timeout/WebSocket receipt.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core functionality (opening web pages) and adds the WebSocket waiting behavior. Every word earns its place with no redundancy or unnecessary elaboration.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 3 parameters, no annotations, and no output schema, the description provides adequate basic functionality explanation but lacks details about return values, error handling, or IDE-specific constraints. It's minimally viable but has clear gaps in behavioral context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 67% schema description coverage (2 of 3 parameters documented in schema), the description adds meaningful context by explaining that the tool '自动等待接收页面发送的WebSocket数据' which clarifies the purpose of the waitForData parameter. This compensates well for the partial schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the specific action ('在IDE中打开一个新的网页窗口显示指定的URL') and distinguishes it from the sibling tool 'add' by specifying it opens web pages in an IDE environment. It goes beyond the title by adding the WebSocket data waiting functionality.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided about when to use this tool versus alternatives. The description doesn't mention any prerequisites, constraints, or comparison with other tools that might open web pages or handle WebSocket data differently.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v1.0.0- First observed
add - First observed
open_web_page
TDQS
The two tools have completely distinct purposes: one performs a mathematical operation (adding numbers), while the other handles web page interaction (opening a URL and managing WebSocket data). There is no overlap or ambiguity between these functions, making tool selection straightforward for an agent.
The naming is inconsistent: 'add' uses a simple verb without a noun, while 'open_web_page' follows a verb_noun pattern. This mixed convention lacks a predictable structure, though both names are readable. The inconsistency could cause minor confusion in a larger set.
With only 2 tools, the server feels thin for a 'Communication Server' domain, which typically implies broader functionality like messaging, notifications, or data exchange. The tools cover basic math and web display but lack operations for communication workflows, making the count insufficient for the apparent scope.
The server is severely incomplete for a communication domain. It lacks core operations such as sending/receiving messages, managing connections, or handling events. The existing tools (add and open_web_page) do not align with communication tasks, leaving significant gaps that would cause agent failures in typical use cases.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
A Model Context Protocol (MCP) server for Selise Blocks Cloud integration
Model Context Protocol server for Studex tools, notifications, and profile integrations
A Model Context Protocol server for Wix AI tools
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables creating, modifying, and validating infinite canvas data structures according to the JSON Canvas 1.0 specification.714MIT
- AlicenseNot gradedqualityDmaintenanceA server implementation that enables interaction with Figma API through Model Context Protocol (MCP), supporting plugin and widget development with WebSocket communication capabilities.1,7013MIT
- AlicenseNot gradedqualityDmaintenanceA powerful Model Context Protocol (MCP) server implementation that provides standardized interaction with MongoDB databases, supporting complete CRUD operations, async patterns, and real-time updates via SSE.MIT
- FlicenseNot gradedqualityDmaintenanceA server implementation of the Model Context Protocol (MCP) that provides REST API endpoints for managing and interacting with MCP resources.-
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/FuzzyCZX/MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server