Metadata-Version: 2.4
Name: xhr-mcp-server
Version: 0.1.4
Summary: X-HR MCP server using stdio transport
Requires-Python: >=3.13
Description-Content-Type: text/markdown
Requires-Dist: dependency-injector>=4.46.0
Requires-Dist: fastmcp<4.0.0,>=3.2.4
Requires-Dist: httpx>=0.28.1
Requires-Dist: loguru>=0.7.3
Requires-Dist: pydantic>=2.11.4
Requires-Dist: pydantic-settings>=2.9.1
Requires-Dist: python-dotenv>=1.1.0
Requires-Dist: pyyaml>=6.0.2

# XHR MCP Server

Python MCP server for X-HR tools. This package is intended to run as a stdio MCP server so external clients can launch it as a local subprocess and communicate through standard input/output.

## Transport

This server uses MCP `stdio` transport.

It is not intended to expose an HTTP MCP endpoint. MCP clients should start the package command directly and let the client manage the stdio session.

## Install

From PyPI, once published:

```bash
pip install xhr-mcp-server
```

Or run it without a persistent install:

```bash
uvx xhr-mcp-server
```

For local development:

```bash
uv sync
```

## MCP Client Config

Example stdio configuration:

```json
{
  "mcpServers": {
    "xhr": {
      "command": "uvx",
      "args": ["xhr-mcp-server"]
    }
  }
}
```

If the package is installed in the same environment as the MCP client:

```json
{
  "mcpServers": {
    "xhr": {
      "command": "xhr-mcp-server",
      "args": []
    }
  }
}
```

## Local Development

Run from the repository root:

```bash
uv run xhr-mcp-server
```

The installed package exposes the same command:

```bash
xhr-mcp-server
```

## Environment

Common environment variables:

```bash
LOG_LEVEL=DEBUG
LOG_FORMAT=pretty
API_BASE_URL=https://api.dev.x-hr.ai
XHR_PAT=
```

`API_BASE_URL` defaults to `https://api.x-hr.co` when unset. For local testing, set it to the dev API URL shown above.
`XHR_PAT` is optional. When present and the MCP request does not include an authorization header, script tools forward it as `authorization: Bearer <XHR_PAT>`. Script tools also use that authorization header to call `/v1/im/me` and fill `xhr-employee-id` and `xhr-company-id` when they are missing.

## Notes

Database migrations, Alembic, SQLAlchemy, and Postgres are intentionally not part of this package.
