mcp-jobs
MCP server for job search that crawls job listings using Playwright, with a fix for stdout pollution on Windows/WorkBuddy.
README
mcp-jobs (Fixed Edition)
修复版 mcp-jobs:解决 Windows / WorkBuddy 下
console.log污染 stdout 导致 MCPConnection closed的问题。
问题描述
原始 mcp-jobs v1.4.0 在 src/index.ts 和 src/services/storageService.ts 中使用了 console.log() 输出中文日志(如"开始搜索职位"、"搜索完成"等),这些文本输出到 stdout,违反了 MCP 协议的 JSON-RPC 规范。
表现现象:WorkBuddy / Claude Desktop 等 MCP 客户端在调用 mcp_search_job 时报 MCP error -32000: Connection closed。
根因日志:SyntaxError: Unexpected token '开', "开始搜索职位 - 关"... is not valid JSON
修复内容
将以下文件中的所有活跃 console.log() 调用改为 console.error()(走 stderr,不污染 JSON-RPC 流):
| 文件 | 修复行 | 说明 |
|---|---|---|
src/index.ts |
L40, L42, L66, L82, L90 | 爬取配置、搜索结果日志 |
src/services/storageService.ts |
L29 | 数据保存日志 |
修复时间:2026-08-07 | 验证环境:Windows 11 + WorkBuddy + Node.js 22.22.2
安装
# 方案1:npm 安装(从 GitHub)
npm install github.com/YOUR_USERNAME/mcp-jobs-fixed
# 方案2:本地安装
git clone https://github.com/YOUR_USERNAME/mcp-jobs-fixed.git
cd mcp-jobs-fixed
npm install && npm link
# Chromium(Playwright 依赖,必须安装)
npx playwright install chromium
WorkBuddy 配置
在 ~/.workbuddy/mcp.json 中添加:
{
"mcpServers": {
"mcp-jobs": {
"type": "stdio",
"command": "/path/to/node.exe",
"args": ["/path/to/mcp-jobs-fixed/dist/mcp.js"],
"disabled": false
}
}
}
重要:
command必须是 node 的绝对路径,不可写裸node(WorkBuddy 不走系统 PATH)。 Windows 推荐使用 WorkBuddy 自带的便携 Git bash 或绝对路径 node.exe。
故障排查
| 现象 | 可能原因 | 解决 |
|---|---|---|
Connection closed |
stdout 有非 JSON 输出 | 检查 dist/ 下所有 .js 文件的 console.log,改为 console.error |
| 工具未注册 | type: "stdio" 缺失 |
在 mcp.json 中为 mcp-jobs 显式添加 "type": "stdio" |
| 搜索无结果 | Chromium 未安装 | npx playwright install chromium |
| 改了配置但连接器消失 | 信任哈希变化 | 到连接器管理页右上角「自定义连接器」重新点 Trust |
版本
基于 mergedao/mcp-jobs v1.4.0 修复。
License
MIT(同原始仓库)
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.