Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ jobs:
- name: Lint
run: npm run lint

- name: stdio MCP (real client)
run: npm run verify:mcp:stdio

semantic-real:
name: semantic recall (real model)
runs-on: ubuntu-latest
Expand Down
132 changes: 129 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 25 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
{
"name": "mebular",
"name": "@mebular/core",
"version": "0.1.0",
"private": true,
"description": "本地优先的图式记忆系统:为 Hermes 等 Agent 提供跨设备、可离线、可验证的记忆共享层",
"license": "MIT",
"author": "Windsander",
"workspaces": [
"packages/*"
],
"files": [
"dist",
"README.md",
"LICENSE"
],
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/Windsander/Mebular.git"
Expand All @@ -25,13 +35,21 @@
"node": ">=20"
},
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
},
"scripts": {
"build": "tsc",
"build:watch": "tsc --watch",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"test:coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
"test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch",
"lint": "eslint src tests tests-semantic scripts --ext .ts,.mjs",
"lint": "eslint src tests tests-semantic scripts packages/mcp --ext .ts,.mjs",
"verify": "node scripts/verify.mjs",
"verify:at-rest": "node scripts/scan-at-rest.mjs",
"verify:semantic": "node scripts/verify-semantic.mjs",
Expand All @@ -42,6 +60,7 @@
"verify:wan:cross:selftest": "node scripts/wan-sync.mjs selftest",
"verify:wan:cross:selftest:isolated": "node scripts/wan-sync.mjs selftest-isolated",
"bench:snapshot": "node scripts/bench-snapshot.mjs",
"verify:mcp:stdio": "node scripts/verify-mcp-stdio.mjs",
"dev": "node --loader ts-node/esm src/index.ts"
},
"dependencies": {
Expand All @@ -68,6 +87,9 @@
}
},
"devDependencies": {
"@modelcontextprotocol/client": "^2.0.0",
"@modelcontextprotocol/server": "^2.0.0",
"zod": "^4.6.5",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.24",
"@typescript-eslint/eslint-plugin": "^7.0.2",
Expand Down
49 changes: 49 additions & 0 deletions packages/mcp/bin/mebular.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env node
// mebular CLI(@mebular/mcp)
//
// G6.2 实现 `mcp`(stdio MCP server);其余命令按阶段补齐(G6.3+)。

const command = process.argv[2];

async function main() {
switch (command) {
case 'mcp': {
const { startStdioServer } = await import('../src/server.mjs');
await startStdioServer();
return;
}
case '--help':
case '-h':
case undefined:
console.log(
[
'用法:mebular <command>',
'',
'命令:',
' mcp 启动 stdio MCP server(stdio 传输)',
' serve 启动 Streamable HTTP server(G6.3 计划)',
' init 初始化 .mebular 配置(G6.4 计划)',
' keygen 生成用户主密钥(G6.4 计划)',
' print-config 打印各 client 接入片段(G6.4 计划)',
' status 打印记忆状态(G6.3 计划)',
' token 管理访问令牌(G6.3 计划)',
].join('\n'),
);
process.exit(0);
return;
case 'serve':
case 'init':
case 'keygen':
case 'print-config':
case 'status':
case 'token':
console.error(`mebular ${command}:尚未实现(按 G6 计划补齐)`);
process.exit(2);
return;
default:
console.error(`未知命令:${command ?? '(空)'}`);
process.exit(2);
}
}

await main();
26 changes: 26 additions & 0 deletions packages/mcp/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "@mebular/mcp",
"version": "0.1.0",
"description": "Mebular MCP server(stdio + Streamable HTTP):把 Mebular 记忆能力暴露给任意 MCP client",
"license": "MIT",
"private": false,
"type": "module",
"bin": {
"mebular": "./bin/mebular.mjs"
},
"files": [
"bin",
"src"
],
"engines": {
"node": ">=20"
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@mebular/core": "file:../..",
"@modelcontextprotocol/server": "^2.0.0",
"zod": "^4.6.5"
}
}
Loading
Loading