Token导航 LogoToken导航TokenDH.com
alsaniamcp (Alsania Dev) logo
运维云端stdio官方级别未说明来源级核验

alsaniamcp (Alsania Dev)

MCP Server

@alsania-io/mcp

AlsaniaMCP是一个支持动态代理、多传输协议和AI间通信的通用模型上下文协议服务器,适用于AI系统集成和工具管理。

工具数

4

提示词数

0

GitHub Stars

0

资源数

0
TypeScript多协议支持工具管理

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

alsania-dev

提供方

alsania-dev

最后核验

2026/5/17 20:20

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx -y @alsania-io/mcp start

详细介绍

阿尔萨尼亚MCP🌐

具有动态代理、多传输支持和AI到AI通信功能的通用模型上下文协议(MCP)服务器

![License: MIT](https://opensource.org/licenses/MIT) ![TypeScript](https://www.typescriptlang.org/) ![MCP SDK](https://modelcontextprotocol.io)

✨ 特性

  • 🔄 通用MCP代理 -充当AI系统和MCP服务器之间的双向网关
  • 🌍 多运输支持 -STDIO、HTTP/SSE和流式HTTP传输
  • 🎯 动态工具注册表 -按需从多个服务器加载/卸载工具
  • 🔌 HTTP网关 -RESTful API,带有用于流式传输的Server-Sent事件
  • 🔐 安全 -JWT身份验证和BLAKE3哈希
  • 🐳 Docker就绪 -使用Docker和Docker compose轻松部署
  • 📦 NPX支持 -安装并运行 npx @alsania-io/mcp

🚀 快速开始

使用NPX(最简单)

npx -y @alsania-io/mcp start

使用Docker

# Pull and run
docker run -p 8050:8050 alsania-io/mcp:latest

# Or with docker-compose
docker-compose up

本地开发

# Install dependencies
npm install

# Start development server
npm run dev

# Build
npm run build

# Start production server
npm start

📡 传输层

AlsaniMCP支持三种传输机制:

1.STDIO传输(本地MCP服务器)

通过stdin/stdout连接到本地MCP服务器:

# Server automatically uses STDIO for local communication

2.HTTP/SSE网关(远程客户端)

通过HTTP REST API向远程客户端公开工具:

  • 基础URL: http://localhost:8050
  • SSE流: http://localhost:8050/sse
  • 健康检查: http://localhost:8050/health

3.HTTP代理传输(远程MCP服务器)

使用Streamable HTTP连接到远程MCP服务器:

POST /proxy/connect
{
  "id": "remote-server",
  "transport": "http",
  "endpoint": "http://remote-mcp-server.com/mcp"
}

🛠️ API终点

核心终点

  • GET /health -健康检查
  • GET /stream -通知的SSE流式端点
  • POST /message -调用工具(需要:服务器ID、工具名称、参数)
  • GET /tools -列出所有可用工具
  • GET /resources -列出所有资源
  • POST /resource -阅读特定资源
  • GET /prompts -列出所有提示
  • POST /prompt -获取带有参数的提示

代理管理

  • POST /proxy/connect -连接到外部MCP服务器
  • POST /proxy/disconnect/:serverId -断开服务器连接
  • GET /proxy/servers -列出活动代理连接
  • GET /proxy/status/:serverId -获取服务器状态

📋 使用示例

连接到远程MCP服务器

curl -X POST http://localhost:8050/proxy/connect \
  -H "Content-Type: application/json" \
  -d '{
    "id": "github-server",
    "transport": "http",
    "endpoint": "http://localhost:3000/mcp"
  }'

调用工具

curl -X POST http://localhost:8050/message \
  -H "Content-Type: application/json" \
  -d '{
    "serverId": "core",
    "toolName": "echo",
    "args": {"message": "Hello AlsaniaMCP!"}
  }'

列出所有工具

curl http://localhost:8050/tools

流通知(SSE)

curl -N http://localhost:8050/stream

🏗️ 建筑

┌─────────────────────────────────────────┐
│            AlsaniaMCP                   │
│  ┌──────────────────────────────────┐   │
│  │      CoreMCPSerber               │   │
│  │   - Tool Registry                │   │
│  │   - Resource Registry            │   │
│  │   - Prompt Registry              │   │
│  └──────────────────────────────────┘   │
│                                          │
│  ┌──────────────────────────────────┐   │
│  │   MCPProxyManager                │   │
│  │   - STDIO Transport              │   │
│  │   - HTTP Transport               │   │
│  │   - Dynamic Loading              │   │
│  └──────────────────────────────────┘   │
│                                          │
│  ┌──────────────────────────────────┐   │
│  │   HTTPGateway                    │   │
│  │   - REST API                     │   │
│  │   - SSE Streaming                │   │
│  │   - Proxy Endpoints              │   │
│  └──────────────────────────────────┘   │
└─────────────────────────────────────────┘

🔧 配置

环境变量

  • PORT -HTTP网关端口(默认:8050)
  • SESSION_SECRET -用于身份验证的JWT密钥
  • NODE_ENV -环境(开发/生产)

服务器配置示例

const config: MCPServerConfig = {
  id: 'my-server',
  transport: 'http',
  endpoint: 'http://localhost:3000/mcp',
  lifespan: 3600000, // 1 hour
  permissions: {
    tools: ['read', 'write'],
    resources: ['read']
  }
};

🔒 安全

  • JWT身份验证 -安全会话管理
  • BLAKE3散列 -快速安全的加密哈希
  • 环境秘密 -存储在环境变量中的API密钥
  • 输入验证 -对所有输入进行Zod模式验证

📦 CLI命令

AlsaniMCP提供了一个全面的命令行界面,用于管理所有服务器操作、通信、语音功能和工具执行。

服务器管理

# Start the server
alsaniamcp server start [-p 
] [-d] [-v] [-c ]

# Stop the server
alsaniamcp server stop [-p 
] [-f]

# Check server status
alsaniamcp server status [-p 
] [-d]

# View server logs
alsaniamcp server logs [-f] [-n 
]

# Aliases: amcp server start, alsaniamcp/amcp

语音控制

# Check voice API support
alsaniamcp voice check

# Show voice configuration
alsaniamcp voice config

AI到AI通信

# List connected AI peers
alsaniamcp comm peers

# Send message to specific peer
alsaniamcp comm send 
 ""

# Broadcast message to all peers
alsaniamcp comm broadcast ""

动态服务器生成

# List available server configurations
alsaniamcp spawn list

# Start a predefined MCP server
alsaniamcp spawn start  # type: filesystem|git|github

# Stop a spawned server
alsaniamcp spawn stop 

# Show server status
alsaniamcp spawn status

工具管理

# List available MCP tools
alsaniamcp tools list [-s ]

# Call an MCP tool
alsaniamcp tools call   [-a ]

配置

# Initialize configuration files
alsaniamcp config init [-f]

# Validate current configuration
alsaniamcp config validate

传统命令(向后兼容)

# Deprecated - use "server start" instead
alsaniamcp start

# Deprecated - use "config init" instead
alsaniamcp init

# Deprecated - use "comm" commands instead
alsaniamcp proxy

🐳 Docker部署

构建图像

docker build -t alsania-io/mcp:latest .

运行容器

docker run -d \
  -p 8050:8050 \
  -e SESSION_SECRET=your-secret-here \
  --name alsaniamcp \
  alsania-io/mcp:latest

Docker Compose

docker-compose up -d

🧪 发展

项目结构

src/
├── cli/            # CLI command handlers
├── communication/  # AI-to-AI communication
│   └── a2a.ts      # AI-to-AI communication logic
├── core/           # Core MCP server implementation
│   └── server.ts   # Universal MCP server
├── proxy/          # MCP proxy manager
│   └── mcp-proxy.ts# MCP proxy implementation
├── security/       # Security utilities
├── spawner/        # Dynamic server spawning
├── transport/      # HTTP gateway and transports
│   └── http-gateway.ts # HTTP gateway implementation
├── types/          # TypeScript type definitions
│   └── index.ts    # Type definitions
├── utils/          # Utility functions
│   └── hash.ts     # BLAKE3 hashing utilities
├── voice/          # Voice activation and processing
├── cli.ts          # CLI implementation
└── index.ts        # Entry point

脚本

  • npm run dev -以监视模式启动开发服务器
  • npm run build -将TypeScript构建为JavaScript
  • npm start -启动生产服务器(已验证工作正常)
  • npm run cli -运行CLI命令
  • npm test -运行测试(待实施的测试)

✅ 当前状态(更新于2025年10月12日)

✅ 已验证工作

  • ✅ 已安装依赖项(199个软件包,0个漏洞)
  • ✅ TypeScript构建成功
  • ✅ 生产服务器启动并运行
  • ✅ 已配置Docker设置(Docker 28.2.2,Docker compose 1.29.2)
  • ✅ 多传输支持(STDIO、HTTP/SSE、流式HTTP)
  • ✅ 实现JWT身份验证和BLAKE3哈希
  • ✅ 带有用于流式传输的服务器端事件的REST API

🏗️ 架构组件

  • ✅ 带有工具/资源/提示注册表的通用MCP服务器
  • ✅ 具有动态加载/卸载功能的MCP代理管理器
  • ✅ 具有REST API和SSE流的HTTP网关
  • ✅ CLI界面(alsaniamcp / amcp 命令)
  • ✅ AI到AI通信框架(已实施)
  • ✅ 语音激活和语音处理(已实现)
  • ✅ 动态MCP服务器生成(已实现)
  • 🔄 集成测试框架(开发中)

📊 代码度量

  • 语言:TypeScript 5.x
  • 运行时:带ES模块的Node.js
  • 测试:当前未实施任何测试
  • 依赖项:199个软件包,主要是MCP SDK和实用程序

🎯 路线图(更新)

  • \[x\] 第一阶段-核心MVP ✅ 完成

- \[x\] 带JSON-RPC 2.0的核心MCP服务器 - \[x\] 动态代理/注册表系统 - \[x\] 多传输层(STDIO、HTTP/SSE) - \[x\] HTTP流网关 - \[x\] 流式HTTP代理传输

  • \[x\] 第2阶段-高级功能 ✅ 完成

- \[x\] AI到AI通信框架(已实施) - \[x\] 语音激活和语音处理(已实现) - \[x\] 动态MCP服务器生成(已实现) - \[x\] 带有关键字检测的语音激活(已实现) - \[x\] 语音转文本和文本转语音(已实现) - \[x\] 集成语音命令处理(已实现)

  • \[ \] 第3阶段-企业就绪

- \[\]高级安全层 - \[\]混沌测试框架 - \[\]性能监控 - \[\]单元和集成测试 - \[\]综合文件

📄 许可证

MIT许可证-有关详细信息,请参阅许可证文件

🤝 贡献

欢迎投稿!请随时提交拉取请求。

📞 支持

______________________________________________________________________

内置于❤️ 使用 模型上下文协议

目录标签

目录标签

TypeScript多协议支持工具管理AI通信本地部署动态代理RESTAPI

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@alsania-io/mcp

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP