Token导航 LogoToken导航TokenDH.com
Node Candidate MCP Server logo
AI代理未说明官方级别未说明来源级核验

Node Candidate MCP Server

MCP Server

一个为LLM提供候选人信息的模型上下文协议(MCP)服务器库,支持简历、LinkedIn、GitHub等资源的访问和邮件联系功能。

工具数

0

提示词数

0

GitHub Stars

81

资源数

0
TypeScript模型集成AI代理

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

jhgaylor

提供方

jhgaylor

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

候选MCP服务器库

一种模型上下文协议(MCP)服务器,允许LLM访问有关候选人的信息。

概述

重要:此服务器旨在用作集成到其他应用程序中的库,而不是作为独立服务。提供的启动方法仅用于演示和测试目的。

资源

此MCP服务器提供以下资源:

  • candidate-info://resume-text:将内容恢复为文本
  • candidate-info://resume-url:简历的URL
  • candidate-info://linkedin-url:领英个人资料URL
  • candidate-info://github-url:GitHub配置文件URL
  • candidate-info://website-url:个人网站URL
  • candidate-info://website-text:来自个人网站的内容

工具

此MCP服务器还提供返回相同候选信息的工具:

  • get_resume_text:以文本形式返回候选人的简历内容
  • get_resume_url:返回候选人简历的URL
  • get_linkedin_url:返回候选人的LinkedIn个人资料URL
  • get_github_url:返回候选人的GitHub配置文件URL
  • get_website_url:返回候选人的个人网站URL
  • get_website_text:返回候选人个人网站的内容
  • contact_candidate:向候选人发送电子邮件(需要Mailgun配置)

用法

npm install @jhgaylor/candidate-mcp-server

图书馆使用情况

此软件包旨在导入并在您自己的应用程序中使用。

标准输入输出

使用stdio启动该过程轻而易举。有趣的部分是提供候选配置。

从哪里获取候选配置完全取决于您。也许你对它进行了硬编码。也许你在启动流程时使用了JSONResume url。这取决于你!

import { createServer } from '@jhgaylor/candidate-mcp-server';
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

// Configure your server
const serverConfig = { 
  name: "MyCandidateServer", 
  version: "1.0.0",
  mailgunApiKey: process.env.MAILGUN_API_KEY,
  mailgunDomain: process.env.MAILGUN_DOMAIN
};
const candidateConfig = { 
  name: "John Doe",
  email: "john.doe@example.com", // Required for the contact_candidate tool
  resumeUrl: "https://example.com/resume.pdf",
  // other candidate properties
};

// Create server instance
const server = createServer(serverConfig, candidateConfig);

// Connect with your preferred transport
await server.connect(new StdioServerTransport());
// or integrate with your existing HTTP server

流式Http

使用typescriptsdk提供的示例代码,我们可以将此mcp服务器绑定到express服务器。

import express from 'express';
import { Request, Response } from 'express';
import { createServer } from '@jhgaylor/candidate-mcp-server';
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamablehttp.js";

// Configure your server
const serverConfig = { 
  name: "MyCandidateServer", 
  version: "1.0.0",
  mailgunApiKey: process.env.MAILGUN_API_KEY,
  mailgunDomain: process.env.MAILGUN_DOMAIN,
  contactEmail: "john.doe@example.com",
};
const candidateConfig = { 
  name: "John Doe",
  resumeUrl: "https://example.com/resume.pdf",
  // other candidate properties
};

// Factory function to create a new server instance for each request
const getServer = () => createServer(serverConfig, candidateConfig);

const app = express();
app.use(express.json());

app.post('/mcp', async (req: Request, res: Response) => {
  // In stateless mode, create a new instance of transport and server for each request
  // to ensure complete isolation. A single instance would cause request ID collisions
  // when multiple clients connect concurrently.
  
  try {
    const server = getServer(); 
    const transport = new StreamableHTTPServerTransport({
      sessionIdGenerator: undefined,
    });
    res.on('close', () => {
      console.log('Request closed');
      transport.close();
      server.close();
    });
    await server.connect(transport);
    await transport.handleRequest(req, res, req.body);
  } catch (error) {
    console.error('Error handling MCP request:', error);
    if (!res.headersSent) {
      res.status(500).json({
        jsonrpc: '2.0',
        error: {
          code: -32603,
          message: 'Internal server error',
        },
        id: null,
      });
    }
  }
});

app.get('/mcp', async (req: Request, res: Response) => {
  console.log('Received GET MCP request');
  res.writeHead(405).end(JSON.stringify({
    jsonrpc: "2.0",
    error: {
      code: -32000,
      message: "Method not allowed."
    },
    id: null
  }));
});

app.delete('/mcp', async (req: Request, res: Response) => {
  console.log('Received DELETE MCP request');
  res.writeHead(405).end(JSON.stringify({
    jsonrpc: "2.0",
    error: {
      code: -32000,
      message: "Method not allowed."
    },
    id: null
  }));
});

// Start the server
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
  console.log(`MCP Stateless Streamable HTTP Server listening on port ${PORT}`);
});

快速

您可以使用以下命令,而不是自己编写express和mcp传输之间的绑定 express-mcp-handler 为你做这件事。

npm install express-mcp-handler

import express from 'express';
import { statelessHandler } from 'express-mcp-handler';
import { createServer } from './server';

// You can configure the server factory to include Mailgun settings
const createServerWithConfig = () => {
  const serverConfig = { 
    name: "MyCandidateServer", 
    version: "1.0.0",
    mailgunApiKey: process.env.MAILGUN_API_KEY,
    mailgunDomain: process.env.MAILGUN_DOMAIN,
    contactEmail: "john.doe@example.com",
  };
  const candidateConfig = { 
    name: "John Doe",
    resumeUrl: "https://example.com/resume.pdf",
    // other candidate properties
  };
  
  return createServer(serverConfig, candidateConfig);
};

// Configure the stateless handler
const handler = statelessHandler(createServerWithConfig);

// Create Express app
const app = express();
app.use(express.json());

// Mount the handler (stateless only needs POST)
app.post('/mcp', handler);

// Start the server
const PORT = process.env.PORT || 3002;
app.listen(PORT, () => {
  console.log(`Stateless MCP server running on port ${PORT}`);
});

发展

# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode with auto-restart
npm run dev

通过stdio进行演示/调试启动

# Start with STDIO (demo only)
npm start

当使用STDIO运行时,您可以通过将MCP消息作为单行JSON对象发送来与服务器交互:

# Example of sending an initialize message via STDIO
echo '{"jsonrpc": "2.0","id": 1,"method": "initialize","params": {"protocolVersion": "2024-11-05","capabilities": {"roots": {"listChanged": true},"sampling": {}},"clientInfo": {"name": "ExampleClient","version": "1.0.0"}}}' | node dist/index.js --stdio

# List resources
echo '{"jsonrpc": "2.0","id": 2,"method": "resources/list","params": {}}' | node dist/index.js --stdio

# Access a resource
echo '{"jsonrpc": "2.0","id": 3,"method": "resources/read","params": {"uri": "candidate-info://resume-text"}}' | node dist/index.js --stdio

# List Tools
echo '{"jsonrpc": "2.0","id": 2,"method": "tools/list","params": {}}' | node dist/index.js --stdio

# Call a tool
echo '{"jsonrpc": "2.0","id": 4,"method": "tools/call","params": {"name": "get_resume_text", "args": {}}}' | node dist/index.js --stdio

# Send an email to the candidate
echo '{"jsonrpc": "2.0","id": 5,"method": "tools/call","params": {"name": "contact_candidate", "args": {"subject": "Hello from AI!", "message": "This is a test email sent via the MCP server.", "reply_address": "recruiter@company.com"}}}' | node dist/index.js --stdio

每条消息必须在一行上,JSON对象内没有换行符。

特性

  • 库优先设计,可集成到其他应用程序中
  • 模块化资源系统,用于扩展自定义候选人信息
  • TypeScript用于类型安全和更好的开发人员体验
  • 实现完整的模型上下文协议规范
  • 支持多种传输类型(STDIO、HTTP、流式HTTP)
  • 最小依赖性

服务器结构

src/
  ├── index.ts                # Main package entry point
  ├── server.ts               # MCP server factory with configuration
  ├── config.ts               # Configuration type definitions
  └── resources/              # Modular resource definitions
      └── index.ts            # Resource factory and implementation

MCP协议

这个库实现了 模型上下文协议 (MCP),LLM与外部数据和功能交互的标准化方式。当集成到应用程序中时,它会公开一个无状态的API,用于响应JSON-RPC请求。

API使用

一旦集成到您的应用程序中,客户端就可以通过发送JSON-RPC请求与MCP服务器进行交互。以下是集成此库后应用程序将处理的请求示例:

初始化

curl -X POST http://your-application-url/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "capabilities": {
        "roots": {
          "listChanged": true
        },
        "sampling": {}
      },
      "clientInfo": {
        "name": "ExampleClient",
        "version": "1.0.0"
      }
    }
  }'

访问候选人资源

curl -X POST http://your-application-url/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Accept: text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "method": "resources/read",
    "params": {
      "uri": "candidate-info://resume-text"
    },
    "id": 2
  }'

扩展图书馆

此库旨在使用自定义资源、工具和提示进行扩展。以下是如何添加自己的资源:

import { McpServer, Resource } from '@jhgaylor/candidate-mcp-server';

// Create your custom resource class
class CustomCandidateResource extends Resource {
  constructor(candidateConfig) {
    super(
      `${candidateConfig.name} Custom Data`, 
      "candidate-info://custom-data", 
      async () => {
        return {
          contents: [
            { 
              uri: "candidate-info://custom-data", 
              mimeType: "text/plain", 
              text: "Your custom candidate data here"
            }
          ]
        };
      }
    );
  }
}

// Create server with standard configuration
const server = createServer(serverConfig, candidateConfig);

// Add your custom resource
const customResource = new CustomCandidateResource(candidateConfig);
customResource.bind(server);

// Connect with preferred transport
// ...

添加自定义工具

您还可以使用自定义工具扩展库:

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { z } from 'zod';
import { createServer } from '@jhgaylor/candidate-mcp-server';

// Create server with standard configuration
const server = createServer(serverConfig, candidateConfig);

// Add a custom tool
server.tool(
  'get_candidate_skills',
  'Returns a list of the candidate skills',
  {},
  async (_args, _extra) => {
    return {
      content: [
        { 
          type: "text", 
          text: "JavaScript, TypeScript, React, Node.js, MCP Protocol" 
        }
      ]
    };
  }
);

// Connect with preferred transport
// ...

需求

  • Node.js 20+
  • npm或纱线

许可证

麻省理工学院

发布到npm

如果你还没有登录npm:

npm login

将包发布到npm(将运行prepublishOnly构建):

npm publish

要碰撞、标记和推送新版本,请执行以下操作:

npm version patch    # or minor, major
git push origin main --tags

目录标签

目录标签

TypeScript模型集成AI代理候选人信息本地部署LLM集成简历解析邮件通知协议服务器

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明session部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP