hp-mcp
# @kotoragk/hp-mcp
A **sample MCP (Model Context Protocol) server** that exposes the kotoragk HP
(homepage) public API as read-only tools. It is intentionally small: a thin HTTP
client that fetches the existing HP endpoints and returns the JSON to the model.
Use it as a reference for how to build and publish an MCP server in TypeScript.
## Tools
| Tool | Arguments | Description |
|------|-----------|-------------|
| `get_news` | `page?` (number) | News (お知らせ) list with count and categories |
| `get_news_detail` | `newsnumber` (number) | A single news article, with prev/next links |
| `get_company` | — | Company (会社情報) profile |
Each tool calls `${HP_API_BASE_URL}/hp/...` and returns the raw JSON.
## Install into Claude Code
```bash
claude mcp add hp -- npx -y @kotoragk/hp-mcp
```
To point at a different backend (e.g. a local Django server), pass the env var:
```bash
claude mcp add hp -e HP_API_BASE_URL=http://127.0.0.1:8000 -- npx -y @kotoragk/hp-mcp
```
| Env var | Default | Description |
|---------|---------|-------------|
| `HP_API_BASE_URL` | `https://kotoragk.com` | Base URL of the HP API (no trailing `/hp`) |
## Local development
```bash
npm install
npm run build # compiles src/ -> dist/
npm start # runs dist/index.js on stdio
```
The server speaks the MCP protocol over **stdio**, so running it directly just
waits for a client. Use an MCP client (Claude Code, the MCP Inspector, etc.) to
interact with it.
## Publish
```bash
npm login
npm publish --access public
```
TDQS
Scored across 3 tools
The three tools target clearly distinct purposes: news listing, news detail, and company profile. get_news and get_news_detail are related but well-differentiated by list vs. single-article granularity. The main potential confusion is an agent confusing get_news's list vs. detail, but the descriptions make the distinction clear.
All tools follow a consistent get_<noun> pattern with snake_case, which is predictable and readable. The only minor deviation is the mixed use of get_news (list) vs. get_news_detail (single), which slightly breaks the implied noun granularity, but overall the convention is uniform.
Three tools is on the low end but borderline acceptable for a simple company HP content server. The scope appears to be news + company info, which a 3-tool set could plausibly cover, though it feels thin for a full website.
The news lifecycle (list + detail) and company profile are covered with no dead ends for the demonstrated use case. However, there are notable gaps: no pagination/create/update/delete for news, no other HP sections (e.g., product listings, contact info), and reading is the only supported operation. For a read-only company wiki this is acceptable, but it lacks breadth.