Windsurf信用储蓄MCP
保存Windsurf积分的MCP服务器。与其结束对话 LLM调用此工具通过临时文件等待用户输入。
运作原理
- LLM电话
wait_for_user_input而不是结束谈话 - 工具在编辑器中打开输入文件并等待更改
- 用户写入消息并保存文件
- 工具会立即将消息返回给LLM
- LLM继续响应——不需要新的UI消息=已保存学分
设置
Linux/macOS
cd llm-response-mcp
bun install输入文件位置: /tmp/windsurf_user_input.txt
视窗
- 安装Bun:https://bun.sh/docs/installation
- 运行:
cd llm-response-mcp
bun install输入文件位置: %TEMP%\windsurf_user_input.txt (例如。 C:\Users\\AppData\Local\Temp\windsurf_user_input.txt)
在Windsurf中配置
Linux/macOS
添加到 ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"credit-saver": {
"command": "bun",
"args": ["run", "/path/to/llm-response-mcp/index.ts"]
}
}
}视窗
添加到 %USERPROFILE%\.codeium\windsurf\mcp_config.json:
{
"mcpServers": {
"credit-saver": {
"command": "bun",
"args": ["run", "C:\\path\\to\\llm-response-mcp\\index.ts"]
}
}
}工具
| 工具 | 说明 |
|---|---|
wait_for_user_input | 等待用户写入输入文件 |
get_input_file | 返回输入文件的路径 |
LLM规则
将此添加到您的Windsurf全局规则中,以强制LLM使用此工具:
## Credit Saver Protocol
CRITICAL: Never end your response without calling the `mcp0_wait_for_user_input`
tool from the credit-saver MCP server.
Instead of finishing a response and waiting for the user to type in the chat UI:
1. Complete your current task/response
2. Call `mcp0_wait_for_user_input()` to wait for the user's next message via the temp file
3. When you receive the user's message, continue working on their request
4. Repeat - always end with another `mcp0_wait_for_user_input()` call
This saves credits by keeping the conversation going through the file system instead of the UI.
The only exception is if the user explicitly says "end conversation" or "stop" or "goodbye".