本项目需要安装LLM CLI。你可以使用Homebrew进行安装:
brew install llm
安装后,请确保llm命令在你的PATH中可用,可以通过运行以下命令来检查:
llm --version
安装依赖项:
npm install
启动具有热重载功能的开发服务器:
npm run dev
构建项目:
npm run build
运行测试:
npm test
启动生产服务器:
npm start
架构工具(src/tools/architect.ts)提供了一个与LLM CLI交互以获取架构设计反馈的接口。它维护对话上下文,并处理应用程序与LLM CLI之间的通信。
模板包括内置的TestClient用于本地测试以及MCP Inspector用于可视化调试。
TestClient提供了一种简单的方式来测试你的工具:
import { TestClient } from "./utils/TestClient";
describe("YourTool", () => {
const client = new TestClient();
it("应正确处理数据", async () => {
await client.assertToolCall(
"your-tool-name",
{ input: "test" },
(result) => {
expect(result.toolResult.content).toBeDefined();
}
);
});
});
模板包括MCP Inspector用于你的工具的可视化调试:
启动Inspector:
npx @modelcontextprotocol/inspector node dist/index.js
在http://localhost:5173打开Inspector UI
Inspector提供了:
要使用Cursor进行本地MCP服务器测试:
构建并链接包:
npm run build
npm run link
验证二进制文件是否工作:
npx architect-test-mcp-tool
将服务器添加到Cursor:
npx architect-test-mcp-tool通过检查MCP服务器部分显示你的服务器正在运行来验证服务器在Cursor中的启动情况。
注意:如果你对代码进行了更改,请记得重新构建和重新链接:
npm run build
npm run link
完成测试后,可以取消链接包:
npm run unlink
这将移除开发期间创建的全局符号链接。
MCP Inspector是一个有用的调试和检查MCP服务器的工具。使用方法如下:
首先,构建你的项目:
npm run build
运行Inspector:
npx @modelcontextprotocol/inspector node dist/index.js
Inspector提供了一个Web界面,允许你: