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
11 changes: 11 additions & 0 deletions .changeset/brief-mode-optimization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@yonaka15/mcp-server-redmine": minor
---

Add Brief Mode optimization with selective custom field filtering

- Add configurable brief mode formatting with `detail_level` parameter for 92% context reduction
- Implement selective custom field filtering by field name (supports string array)
- Add enhanced description truncation with configurable length
- Add field discovery workflow with XML warnings for missing fields
- Maintain 100% backward compatibility with existing API calls
50 changes: 49 additions & 1 deletion README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,55 @@ Redmine REST API の Stable なリソースに対応しています:
- カスタムフィールド対応
- 作業時間の削除

## Brief Mode 最適化

このサーバーは、コンテキストウィンドウの効率的な利用のために Brief Mode 最適化機能を提供します。

### 主な利点

- **95% のサイズ削減**: 出力サイズを大幅に削減し、コンテキストウィンドウを効率的に活用
- **拡張されたフィールド選択**: カスタムフィールドを名前で選択的にフィルタリング
- **スマートなデフォルト**: デフォルトで切り詰められた説明を含み、空のカスタムフィールドを除外
- **フィールド発見ワークフロー**: 利用可能なカスタムフィールドを見つけるための警告システム
- **100% 後方互換性**: 既存の API 呼び出しは変更なしで動作

### 使用方法

#### 基本的な Brief モード

```bash
# Brief モードでチケット取得
npx @modelcontextprotocol/inspector dist/index.js

# get_issue ツールで以下のパラメータを使用:
{
"id": 123,
"detail_level": "brief"
}
```

#### カスタマイズされた Brief モード

```bash
# 特定のフィールドを含む Brief モード
{
"id": 123,
"detail_level": "brief",
"brief_fields": "{\"assignee\":true,\"dates\":true,\"category\":true}",
"max_description_length": 300,
"max_journal_entries": 5
}
```

### 設定オプション

- `detail_level`: `"brief"` または `"full"` (デフォルト: `"full"`)
- `brief_fields`: 含めるフィールドを指定する JSON 文字列
- `max_description_length`: Brief モードでの説明文の最大長 (デフォルト: 200)
- `max_journal_entries`: Brief モードでの履歴エントリの最大数 (デフォルト: 3)

詳細な情報については、[OPTIMIZATION_GUIDE.md](./OPTIMIZATION_GUIDE.md) を参照してください。

## Claude での利用

Claude でこのサーバーを利用する場合、以下のような設定を行います:
Expand Down Expand Up @@ -202,4 +251,3 @@ MIT
- [Model Context Protocol](https://modelcontextprotocol.io/)
- [MCP TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk)
- [Redmine](https://www.redmine.org/)

59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,65 @@ Supports stable resources from Redmine REST API:
- Users (1.1~)
- Time Entries (1.1~)

### Brief Mode Optimization

The server includes an advanced **Brief Mode** feature that reduces context window usage by up to 95% while maintaining essential information. This is particularly useful for LLMs with limited context windows or when processing large numbers of issues.

#### Key Benefits

- **95% size reduction**: Dramatically reduces output size for better context management
- **Enhanced field selection**: Selective custom field filtering by field name
- **Smart defaults**: Includes truncated descriptions by default, excludes empty custom fields
- **Field discovery workflow**: Warning system helps users find available custom fields
- **100% backward compatible**: Existing API calls work unchanged
- **Maintains essential data**: Always includes core fields like ID, subject, project, status, and priority

#### Usage

Add `detail_level: 'brief'` to any issue query:

```bash
# Brief mode with default fields
npx @modelcontextprotocol/inspector --cli \
-e REDMINE_API_KEY=$REDMINE_API_KEY \
-e REDMINE_HOST=$REDMINE_HOST \
node dist/index.js \
--method tools/call \
--tool-name get_issue \
--tool-arg id=1 \
--tool-arg detail_level=brief

# Custom field configuration
npx @modelcontextprotocol/inspector --cli \
-e REDMINE_API_KEY=$REDMINE_API_KEY \
-e REDMINE_HOST=$REDMINE_HOST \
node dist/index.js \
--method tools/call \
--tool-name list_issues \
--tool-arg detail_level=brief \
--tool-arg brief_fields='{"assignee":true,"dates":true,"description":true}' \
--tool-arg max_description_length=150
```

#### Configuration Options

- `detail_level`: Set to `'brief'` to enable brief mode
- `brief_fields`: JSON string specifying which optional fields to include:
- `assignee`: Include assigned user information
- `dates`: Include start/due dates
- `description`: Include description (`true` for full, `"truncated"` for default, `false` to exclude)
- `custom_fields`: Include custom field values (`false` to exclude, `true` for all non-empty, `["Field1", "Field2"]` for specific fields by name)
- `category`: Include issue category
- `version`: Include target version
- `time_tracking`: Include progress and time estimates
- `journals`: Include recent journal entries
- `relations`: Include issue relations
- `attachments`: Include attachment information
- `max_description_length`: Maximum length for descriptions (default: 200)
- `max_journal_entries`: Maximum number of journal entries (default: 3)

For detailed information, see [OPTIMIZATION_GUIDE.md](OPTIMIZATION_GUIDE.md).

### Tools

#### Issues
Expand Down
Loading