Token导航 LogoToken导航TokenDH.com
Hr Policy MCP logo
AI代理stdio官方来源来源级核验

Hr Policy MCP

MCP Server

提供策略资源并维护策略记录供AI代理使用,同时提供简单的数学工具,并通过官方`modelcontextprotocol/python-sdk`将所有MCP服务器整合到一个受身份验证保护的MCP端点。

工具数

0

提示词数

0

GitHub Stars

1

资源数

0
身份验证PythonAI代理

安装说明

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

作者 / 组织

abneetwats24

提供方

abneetwats24

最后核验

2026/5/17 20:20

运行时

Python

快速接入

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

命令预览

uv run src/main.py

详细介绍

人力资源策略MCP服务器

此服务器提供策略资源并维护策略记录,供AI代理使用。

它还公开了简单的数学工具,并将两个MCP服务器组合在一个单独的 使用官方身份验证保护的MCP端点 modelcontextprotocol/python-sdk.

应用程序设计流程

flowchart LR
subgraph ControlPlane[Control Plane]
subgraph Registry[Agent Registry]
AgentASG[Agent A-JSON]
AgentBSG[Agent B-JSON]
AgentCSG[Agent C-JSON]
end
LGRrouterN[Router/Agent Selector]
end

subgraph OrgServices[Integration/Knowledge]
ServiceA[Service A]
ServiceB[Service B]
ServiceC[Service C]
ServiceD[Service D]
end

Broker[(Message Fabric)]
Observability[(Tracing & Metrics)]

AgentA[Agent A]
AgentB[Agent B]
AgentC[Agent C]

McpA[MCP A]
McpB[MCP B]
McpC[MCP C]

User[User]

User -->|API / WS / Event| Client  
Client --> LGRrouterN
LGRrouterN -->|A2A Message| Registry
AgentA -->|A2A Message| Broker
Broker -->|Deliver| AgentB
Broker -->|Deliver| AgentC

AgentA -->|Response/Heartbeat| AgentASG
AgentB -->|Response/Heartbeat| AgentBSG
AgentC -->|Response/Heartbeat| AgentCSG

AgentASG |Discovery API| AgentA
AgentBSG |Discovery API| AgentB
AgentCSG |Discovery API| AgentC

AgentA --> Observability
AgentB --> Observability
AgentC --> Observability

AgentA  McpA
AgentB  McpB
AgentC  McpC

McpA  ServiceA
McpB  ServiceB
McpC  ServiceD
McpB  ServiceC

目录结构

src/
  main.py                 # Composite MCP server (HR + math) with auth
  hr_policy_mcp/
    __init__.py           # Exposes hr_policy_mcp and registers resources
    server.py             # HR FastMCP instance + PolicyService wiring
    services/
      policy_service.py   # Loads PDF policies from static/dev/policy_files
    resources/
      policies.py         # Registers one MCP resource per policy
  math_mcp/
    __init__.py           # Exposes math_mcp and registers tools
    server.py             # Math FastMCP instance
    tools/
      basic.py            # add / subtract tools
  middleware/
    __init__.py
    token_verifier.py     # OAuth2 token introspection (Keycloak)

static/
  dev/
    policy_files/         # PDF HR policy documents

认证

主MCP服务器的配置类似于 simple-auth 示例中 python SDK。它使用:

  • Keycloak领域发现地点:

http://192.168.10.7:5555/realms/openspace/.well-known/openid-configuration

  • 令牌自检端点:

http://192.168.10.7:5555/realms/openspace/protocol/openid-connect/token/introspect

  • 所需范围: mcp:tools (可通过env配置)。

客户端凭据是通过环境变量提供的(请参见 .env.example).

使用紫外线(本地)运行

uv run src/main.py

复合MCP服务器将监听 http://127.0.0.1:3000/mcp 使用 streamable-http 运输。

码头工人

直接使用Docker构建和运行:

docker build -t hr-policy-mcp .
docker run --rm -p 3000:3000 --env-file .env hr-policy-mcp

或者使用docker compose:

docker compose up --build

MCP端点将在以下位置可用:

http://127.0.0.1:3000/mcp

日志记录

服务器发出两种日志:

  • 标准Python日志

- 配置于 src/main.py 通过 setup_logging(). - 输出到stdout/stderr和 logs/server.log. - 由以下组件使用 PolicyService 报告加载/解析错误。

  • MCP上下文日志记录

- 工具和资源接受 ctx: Context[ServerSession, None] 争论。 - 通过以下方式读取人力资源策略资源日志和失败 ctx.info(...) / ctx.error(...). - 数学工具通过以下方式记录操作 ctx.debug(...). - 这些日志作为通知发送回兼容的MCP客户端。

Keycloak身份验证服务器配置

跟随 钥匙斗篷配置

MCP认证广为人知

要查看众所周知的详细信息:http://127.0.0.1:3000/math/.well-已知/oauth保护的资源 应该输出如下内容:

{"resource":"http://127.0.0.1:3000/","authorization_servers":["http://192.168.10.7:5555/realms/openspace"],"scopes_supported":["mcp:tools"],"bearer_methods_supported":["header"]}

目录标签

目录标签

身份验证PythonAI代理HR策略管理本地部署AI代理服务数学工具MCP集成

接入字段

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

stdio

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

oauth

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

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

0

权限和风险

stdiooauth部署方式未说明

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

安装前确认

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

来源信息

继续浏览同类 MCP