Skip to main content
Glama
theduodecim

ascii-art-mcp

by theduodecim

ascii-art-mcp

ascii-art-mcp 是一个使用 Node.js 和 TypeScript 构建的 模型上下文协议(MCP)服务器,提供从本地数据库检索 ASCII 和 Unicode 艺术 的工具。

该服务器使用 stdio 传输 进行通信,兼容以下 MCP 客户端:

  • Claude Desktop

  • Cursor

  • LM Studio

  • Open WebUI

  • 其他兼容 MCP 的环境

https://theduodecim.github.io/ascii-art-mcp/

▶ 运行此 MCP

只需将此链接放入任何兼容 MCP 的 AI 聊天中:

https://github.com/theduodecim/ascii-art-mcp/tree/main

“运行此 MCP”

AI 将自动克隆仓库、构建并运行它。您无需进行任何设置。


📦 安装

该包可在 npm 上获取:

https://www.npmjs.com/package/ascii-art-mcp

本地安装:

npm install ascii-art-mcp

或直接运行:

npx ascii-art-mcp

🌐 MCP 注册表

该服务器也已发布在官方的 模型上下文协议注册表 中:

https://registry.modelcontextprotocol.io/?q=ascii-art

服务器名称:

io.github.theduodecim/ascii-art

这使得兼容 MCP 的工具能够自动发现并安装它


⚙️ 要求

  • Node.js 20+

  • npm


🚀 手动运行服务器

开发模式:

npm run dev

构建 + 生产运行:

npm run build
npm start

服务器使用 stdio 传输,并从以下位置加载数据:

db.json

位于仓库根目录。


🧰 可用的 MCP 工具

Related MCP server: MusicBrainz MCP Server

get_ascii_art

通过精确的 名称别名 中的精确值查找艺术条目。

输入

字段

类型

必填

query

string

输出

以纯文本形式返回条目的 art 字段。


类别标签 或两者搜索条目。

输入

字段

类型

必填

categoria

string

可选

tag

string

可选

至少需要一个过滤器。

输出

以文本输出形式返回匹配条目的 art 字段组合


random_ascii

从数据库返回一个随机条目。

输入

字段

类型

必填

tipo

ascii | unicode

必填

输出

以纯文本形式返回所选条目的 art 字段


list_categories

列出数据库中存在的所有唯一类别。

输入

输出

换行符分隔的文本形式返回类别名称。


🗂 数据模型

db.json 中的条目遵循 AsciiArtEntry TypeScript 接口

src/types/asciiArt.ts

每个条目包含以下元数据:

  • 名称

  • 类别

  • 标签

  • 别名

  • 艺术内容


🧪 测试 MCP 服务器

使用简单的集成测试来验证通过 stdio 上的 JSON-RPC 进行的 MCP 通信。

示例测试脚本(test.mjs):

import { spawn } from "child_process";

const proc = spawn("node", ["dist/server.js"], {
  stdio: ["pipe", "pipe", "pipe"]
});

proc.stderr.on("data", (d) => {
  console.log("LOG:", d.toString());
});

proc.stdout.on("data", (d) => {
  console.log("SERVER:", d.toString());
});

function send(msg) {
  const json = JSON.stringify(msg);
  const payload = `Content-Length: ${Buffer.byteLength(json)}\r\n\r\n${json}\r\n`;

  console.log("\nSENDING:\n", json, "\n");

  proc.stdin.write(payload);
}

setTimeout(() => {
  send({
    jsonrpc: "2.0",
    id: 1,
    method: "initialize",
    params: {
      protocolVersion: "2024-11-05",
      capabilities: {},
      clientInfo: {
        name: "tester",
        version: "1.0"
      }
    }
  });
}, 500);

setTimeout(() => {
  send({
    jsonrpc: "2.0",
    method: "initialized",
    params: {}
  });
}, 1000);

setTimeout(() => {
  send({
    jsonrpc: "2.0",
    id: 2,
    method: "tools/list"
  });
}, 1500);

setTimeout(() => {
  proc.kill();
  console.log("TEST FINISHED");
}, 4000);

🧠 架构

src/
  server.ts
  tools/
  types/

dist/

db.json
  • TypeScript MCP 服务器

  • JSON 数据库(db.json

  • 用于工具输入的 Zod 验证

  • stdio 传输


🎯 目的

本项目演示了如何构建一个简单的 MCP 工具服务器,它:

  • 在本地运行

  • 无需 API 密钥

  • 提供结构化工具

  • 通过 MCP 提供静态数据


📜 许可证

MIT

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • MCP server for accessing curated awesome list documentation

  • MCP server exposing the AceDataCloud Fish Audio API (text-to-speech with voice conditioning)

  • An MCP server for deep research or task groups

View all MCP Connectors

Latest Blog Posts

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/theduodecim/ascii-art-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server