@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
66
77- ` pnpm dev ` - Start development server with watch mode
88- ` pnpm build ` - Full build (types + esbuild)
9- - ` pnpm type-check ` - TypeScript type checking
9+ - ` pnpm typecheck ` - TypeScript type checking
1010- ` pnpm lint ` - Run ESLint
1111- ` pnpm inspector ` - MCP inspector for debugging tools
1212- ` node scripts/test-tools.js ` - Quick tool verification
@@ -26,25 +26,19 @@ MCP server that exposes freee API endpoints as MCP tools:
2626 - ` pm-api-schema.json ` - 工数管理API (https://api.freee.co.jp/pm )
2727 - ` sm-api-schema.json ` - 販売API (https://api.freee.co.jp/sm )
2828- ** Schema Loader** : ` src/openapi/schema-loader.ts ` loads and manages all API schemas
29- - ** Tool Generation** : Two modes available (selected via CLI subcommand):
30- - ** Client Mode** (` freee-mcp client ` ): Sub-command tools per HTTP method ** [ RECOMMENDED] **
31- - ` generateClientModeTool() ` in ` src/openapi/client-mode.ts ` creates method-specific tools
32- - Tools: ` freee_api_get ` , ` freee_api_post ` , ` freee_api_put ` , ` freee_api_delete ` , ` freee_api_patch ` , ` freee_api_list_paths `
33- - Automatically detects API type from path and uses correct base URL
34- - Validates paths against all OpenAPI schemas before execution
35- - Reduces context window usage significantly (6 tools vs hundreds)
36- - Supports all 5 freee APIs seamlessly
37- - ** Individual Mode** (` freee-mcp api ` or default): One tool per endpoint
38- - ` generateToolsFromOpenApi() ` in ` src/openapi/converter.ts ` converts OpenAPI paths to MCP tools
39- - Naming with API prefix: ` accounting_get_deals ` , ` hr_get_employees ` , ` invoice_get_delivery_slips ` , ` pm_get_projects ` , ` sm_get_businesses `
40- - Each tool automatically uses the correct base URL for its API
29+ - ** Tool Generation** : ` generateClientModeTool() ` in ` src/openapi/client-mode.ts ` creates method-specific tools
30+ - Tools: ` freee_api_get ` , ` freee_api_post ` , ` freee_api_put ` , ` freee_api_delete ` , ` freee_api_patch ` , ` freee_api_list_paths `
31+ - Automatically detects API type from path and uses correct base URL
32+ - Validates paths against all OpenAPI schemas before execution
33+ - Supports all 5 freee APIs seamlessly
4134- ** Requests** : ` makeApiRequest() ` in ` src/api/client.ts ` handles API calls with auto-auth and company_id injection
4235
4336### Configuration
4437
4538#### Recommended Setup (Config File)
4639
4740Run ` freee-mcp configure ` to set up configuration interactively:
41+
4842- Creates ` ~/.config/freee-mcp/config.json ` with OAuth credentials and company settings
4943- No environment variables needed
5044- More secure (file permissions 0600)
@@ -60,8 +54,8 @@ Run `freee-mcp configure` to set up configuration interactively:
6054
6155### CLI Subcommands
6256
63- - ` freee-mcp client ` - Start in client mode (HTTP method sub-commands)
64- - ` freee-mcp api ` - Start in API mode (individual tools per endpoint) [ default ]
57+ - ` freee-mcp ` - Start MCP server
58+ - ` freee-mcp configure ` - Interactive configuration setup
6559
6660### MCP Configuration
6761
@@ -82,68 +76,24 @@ After running `freee-mcp configure`:
8276
8377Configuration is automatically loaded from ` ~/.config/freee-mcp/config.json ` .
8478
85- #### Using Environment Variables (Deprecated)
86-
87- ⚠️ ** Deprecated: Will be removed in future versions**
88-
89- ** Client Mode (recommended):**
90- ``` json
91- {
92- "mcpServers" : {
93- "freee" : {
94- "command" : " npx" ,
95- "args" : [" @him0/freee-mcp" , " client" ],
96- "env" : {
97- "FREEE_CLIENT_ID" : " your_client_id" ,
98- "FREEE_CLIENT_SECRET" : " your_client_secret" ,
99- "FREEE_CALLBACK_PORT" : " 54321"
100- }
101- }
102- }
103- }
104- ```
105-
106- ** API Mode (individual tools):**
107- ``` json
108- {
109- "mcpServers" : {
110- "freee" : {
111- "command" : " npx" ,
112- "args" : [" @him0/freee-mcp" , " api" ],
113- "env" : {
114- "FREEE_CLIENT_ID" : " your_client_id" ,
115- "FREEE_CLIENT_SECRET" : " your_client_secret" ,
116- "FREEE_COMPANY_ID" : " your_company_id" ,
117- "FREEE_CALLBACK_PORT" : " 54321"
118- }
119- }
120- }
121- }
122- ```
123-
124- ** Client Mode vs Individual Mode** :
125- - Use ` freee-mcp client ` for HTTP method sub-command tools (recommended for large APIs)
126- - 6 tools total: freee_api_ {get,post,put,delete,patch} + freee_api_list_paths
127- - Significantly reduces context window usage
128- - Use ` freee-mcp api ` for individual tools per endpoint (more granular but uses more context)
129- - Hundreds of tools (one per API endpoint)
130-
131- Development mode: Use ` "command": "pnpm", "args": ["tsx", "src/index.ts", "client"] ` with ` "cwd": "/path/to/freee-mcp" `
79+ Development mode: Use ` "command": "pnpm", "args": ["tsx", "src/index.ts"] ` with ` "cwd": "/path/to/freee-mcp" `
13280
13381## PR Creation Pre-flight Checklist
13482
13583** Always run before creating a PR:**
13684
13785``` bash
138- pnpm type-check && pnpm lint && pnpm test:run && pnpm build
86+ pnpm typecheck && pnpm lint && pnpm test:run && pnpm build
13987```
14088
14189** Changeset requirement:**
90+
14291- Run ` pnpm changeset ` to create a changeset file for any user-facing changes
14392- Select the appropriate bump type: ` patch ` (bug fixes), ` minor ` (new features), ` major ` (breaking changes)
14493- Write a concise description of what changed for the CHANGELOG
14594
14695** Common issues:**
96+
14797- Mock function return types (ensure ` id ` fields are strings)
14898- Missing return type annotations on exported functions
14999- Undefined environment variables in tests
0 commit comments