npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

embedded-mcp-server

v1.0.0

Published

MCP server for embedded development tools integration - provides system info, serial ports, GPIO status, and hexdump utilities for embedded development

Readme

嵌入式开发MCP服务器

这是一个为嵌入式开发工具集成而设计的MCP(Model Context Protocol)服务器,使用Node.js构建。它将各种嵌入式开发中常用的工具整合起来,让AI助手能够直接调用这些工具。

功能特性

  • 🔧 工具集成: 统一管理各种嵌入式开发工具
  • 🚀 易于扩展: 模块化设计,方便添加新工具
  • 🎯 MCP兼容: 完全符合MCP协议规范
  • 📊 配置灵活: 支持通过配置文件管理工具和设置

已集成的工具

系统工具

  • system_info: 获取系统基本信息(操作系统、架构、内存等)
  • list_serial_ports: 列出系统中可用的串口设备
  • hexdump: 以十六进制格式查看文件内容

嵌入式专用工具

  • gpio_status: 查询GPIO引脚状态(适用于树莓派等设备)

快速开始

1. 安装依赖

```bash npm install ```

2. 启动服务器

```bash npm start ```

3. 开发模式(自动重启)

```bash npm run dev ```

配置

服务器配置存储在 config.json 文件中:

```json { "server": { "name": "embedded-mcp-server", "version": "1.0.0" }, "tools": { "enabled": ["system_info", "list_serial_ports", "gpio_status", "hexdump"], "disabled": [] }, "settings": { "debug": false, "timeout": 30000 } } ```

工具使用示例

查看系统信息

```json { "name": "system_info", "arguments": { "detail": true } } ```

列出串口设备

```json { "name": "list_serial_ports", "arguments": {} } ```

查看文件十六进制内容

```json { "name": "hexdump", "arguments": { "filepath": "/path/to/firmware.bin", "length": 512, "offset": 0 } } ```

查询GPIO状态

```json { "name": "gpio_status", "arguments": { "pin": 18 } } ```

项目结构

``` embedded_mcp/ ├── index.js # 主服务器文件 ├── package.json # 项目配置和依赖 ├── config.json # 服务器配置 ├── README.md # 项目文档 └── src/ └── tools/ ├── index.js # 工具加载器 ├── base.js # 工具基类 └── example.js # 示例工具实现 ```

添加新工具

  1. src/tools/ 目录下创建新的工具文件
  2. 使用 BaseTool 基类或 createTool 辅助函数创建工具
  3. src/tools/index.js 中导入并添加到工具列表
  4. config.json 中的 enabled 列表里添加工具名称

工具示例

```javascript import { z } from "zod"; import { createTool } from "./base.js";

export const myTool = createTool( "my_tool", "工具描述", z.object({ param1: z.string().describe("参数1描述"), param2: z.number().optional().describe("可选参数2") }), async (args) => { // 工具实现逻辑 const { param1, param2 = 0 } = args;

try {
  // 执行工具功能
  const result = doSomething(param1, param2);
  
  return {
    success: true,
    data: result
  };
} catch (error) {
  return {
    success: false,
    error: error.message
  };
}

} ); ```

在AI助手中使用

这个MCP服务器可以与支持MCP协议的AI助手(如Claude Desktop)集成使用。在AI助手的配置中添加此服务器,即可让AI直接调用嵌入式开发工具。

许可证

MIT License

贡献

欢迎提交Issue和Pull Request来帮助改进这个项目!

常见问题

Q: 如何在Windows上使用?

A: 部分工具(如GPIO查询)可能需要额外的驱动或工具。Windows用户可能需要安装相应的开发工具链。

Q: 支持哪些嵌入式开发板?

A: 目前主要支持树莓派等Linux系统的开发板。其他开发板的支持会陆续添加。

Q: 如何调试工具问题?

A: 在 config.json 中设置 "debug": true,启动服务器时会输出详细的调试信息。