Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .codex/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[mcp_servers.chatwork]
command = "docker"
args = ["run", "--rm", "-i", "--env-file", ".env", "chatwork-mcp-server"]
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
dist
.git
.github
.devcontainer
.env
.env.test
npm-debug.log
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHATWORK_API_TOKEN=
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist

.env.test
.env
.env.test
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:22-bookworm-slim AS builder

WORKDIR /app

COPY package.json package-lock.json ./
RUN npm ci

COPY src ./src
COPY tsconfig.json ./
RUN npm run build

FROM node:22-bookworm-slim AS runner

WORKDIR /app

COPY --from=builder /app/dist ./dist

CMD ["node", "dist/index.js"]
44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Chatwork を AI から操作するための MCP (Model Context Protocol) サーバーです。

英語版は [README_en.md](README_en.md) を参照してください。

## 使い方

Claude Desktop を例に説明します。
Expand All @@ -28,3 +30,45 @@ Claude Desktop を例に説明します。
```

今後、MCP に対応した AI ツールが増える可能性があります。使い方を追加してほしいツールがあった場合、あなたのコントリビュートをお待ちしています!

## Docker + Codex

Docker を使って Codex から利用する場合は、以下の手順でセットアップします。

1. `.env` を作成し、Chatwork API token を設定する

```sh
cp .env.example .env
```

`.env` に `CHATWORK_API_TOKEN` を設定してください。

2. Docker イメージをビルドする

```sh
docker build -t chatwork-mcp-server .
```

3. プロジェクトローカルの Codex 設定 [`.codex/config.toml`](.codex/config.toml) を使う

```toml
[mcp_servers.chatwork]
command = "docker"
args = ["run", "--rm", "-i", "--env-file", ".env", "chatwork-mcp-server"]
```

4. このプロジェクトルートで Codex を起動する

```sh
codex
```

5. Codex をすでに開いていた場合は、新しいセッションを開始するか再起動する

6. Codex 内で `/mcp` を開き、`chatwork` が表示されることを確認する

補足:

- Codex はこの設定では `.mcp.json` ではなく `.codex/config.toml` を使います
- `docker run -d ...` で事前に常駐コンテナを起動しておく必要はありません
- `.env` はプロジェクトルートに置く前提です
72 changes: 72 additions & 0 deletions README_en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Chatwork MCP Server

Chatwork MCP (Model Context Protocol) server for operating Chatwork from AI tools.

## Usage

The following example uses Claude Desktop.

1. Start Claude Desktop
2. Click "Settings" from the menu
3. Click the "Developer" tab
4. Click "Edit Config"
5. When `claude_desktop_config.json` opens in your editor, update it with the following
6. Add this configuration

```json
{
"mcpServers": {
"chatwork": {
"command": "npx",
"args": ["@chatwork/mcp-server"],
"env": {
"CHATWORK_API_TOKEN": "YOUR_CHATWORK_API_TOKEN"
}
}
}
}
```

As more AI tools add MCP support, we may add more usage examples here.

## Docker + Codex

To use this server from Codex with Docker, set it up as follows.

1. Create `.env` and set your Chatwork API token

```sh
cp .env.example .env
```

Set `CHATWORK_API_TOKEN` in `.env`.

2. Build the Docker image

```sh
docker build -t chatwork-mcp-server .
```

3. Use the project-local Codex configuration in [`.codex/config.toml`](.codex/config.toml)

```toml
[mcp_servers.chatwork]
command = "docker"
args = ["run", "--rm", "-i", "--env-file", ".env", "chatwork-mcp-server"]
```

4. Start Codex from this project root

```sh
codex
```

5. If Codex was already open, start a new session or restart it

6. Open `/mcp` in Codex and confirm that `chatwork` is listed

Notes:

- For this setup, Codex uses `.codex/config.toml`, not `.mcp.json`
- You do not need to start a long-running container with `docker run -d ...` in advance
- `.env` is expected to exist at the project root
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"type-check": "tsc",
"test": "vitest run",
"build": "esbuild src/index.ts --minify --bundle --platform=node --format=esm --outfile=dist/index.js",
"dev": "npm run build -- --watch"
"dev": "npm run build -- --watch",
"docker:build": "docker build -t chatwork-mcp-server ."
},
"repository": {
"type": "git",
Expand Down