Skip to content

AIエージェントからPacketProxyを操作するMCPサーバー拡張を、現在のmasterに追加する - #283

Draft
toku-sa-n wants to merge 4 commits into
DeNA:masterfrom
toku-sa-n:feat/mcp-server-on-master
Draft

toku-sa-n wants to merge 4 commits into
DeNA:masterfrom
toku-sa-n:feat/mcp-server-on-master

Conversation

@toku-sa-n

@toku-sa-n toku-sa-n commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

AIエージェントがPacketProxyの履歴を読み、パケットを再送できるようにするMCPサーバーの拡張を、現在のmasterに載せます。

#190 の feat/mcp-server ブランチは2025年8月から更新されておらず、masterとの差が大きくなってそのままではマージできないため、masterの上に載せ直しました。

  • Kotlinで書いたMCPサーバー(extensions/mcp/)と各ツール、HTTPブリッジ(scripts/mcp-http-bridge.js)、設定手順とツール一覧のドキュメント(doc/mcp-server-setting-guide.md・doc/mcp-server-tools.md)を追加しました
  • ツールが送ったパケットを追えるよう、OneShotPacket から Packet へ job_id・temporary_id を引き継ぎ、packetsテーブルに保存するようにしました
  • 設定の読み込みAPIを確認ダイアログなしで呼べるよう、x-suppress-dialog ヘッダーを受け付けるようにしました
  • ログ処理がKotlinの Logging に移ったため、LogTool は Logging.getLogText() からログを読むようにしました
  • /mcp は Authorization: Bearer が必須のため、HTTPブリッジがこのヘッダーを送るようにしました
  • Jacksonを2.10.0から2.19.2に上げました

./gradlew spotlessCheck compileJava compileKotlin test はすべて成功しました。PacketProxyを起動してMCPクライアントからツールを呼ぶ確認は、まだしていません。

Closes #190

🤖 Generated with Claude Code

toku-sa-n and others added 4 commits December 4, 2026 13:30
AI agents used for security testing need to read PacketProxy's history and
resend packets without a human driving the GUI. The MCP server for this has
lived on feat/mcp-server (PR DeNA#190) since 2025-08, but that branch drifted
far from master, so it could not be merged as is.

This brings the extension onto the current master: the MCP server and its
tools, the HTTP bridge script, and the docs, plus the core changes the tools
depend on (job_id / temporary_id carried from OneShotPacket to Packet and
stored in the packets table, and an x-suppress-dialog header so the config
endpoint can be called without a confirmation dialog).

Two adjustments were needed against master. Logging moved to Kotlin, so
LogTool now reads the log text through Logging.getLogText() instead of
GUILog.getInstance(). The HTTP bridge now also sends Authorization: Bearer,
which /mcp requires alongside the access_token in the body.

Closes DeNA#190

Co-authored-by: kakira <kurokuro917@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New code in PacketProxy is being written in Kotlin, and the MCP server
extension added in this branch was still plain Java. Port all 15 files
under extensions/mcp/ to Kotlin so the new feature does not add more
Java that would have to be migrated later.

The port is a straight translation: tool names, descriptions, input
schemas, response keys and log/error messages are unchanged. Java
semantics that differ in Kotlin are kept explicitly (String.split
dropping trailing empties, trim() on chars <= ' ', default charset and
locale, java.util.regex replacement handling).

Unused locals and the unused initialize parameter are dropped instead of
being suppressed, and the deprecated URL(String) constructor is replaced
with URI.toURL().

The small additions to existing Java classes (Packet, OneShotPacket,
Packets, GUILog, Extensions, ConfigHttpServer, DuplexFactory) stay in
Java, since rewriting those files is outside this feature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two docs came over from feat/mcp-server almost unchanged and no longer
matched the code. They described REST endpoints, ports (32350), error codes
and a get_configs tool that do not exist, gave get_history filter examples on
method/url/status (not filterable), told users to install npx and Python, and
spent much of their length on class layout and internal architecture.

The setup guide now covers what the extension does, how to enable it, how to
register the bridge in Claude Desktop and Claude Code, how to check it works,
and the common errors. The spec becomes a tool reference (mcp-server-tools.md)
listing each tool's parameters as the code reads them; parameters that are
accepted but have no effect are left out. Implementation details are left to
the code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI's spotlessCheck failed on the rewritten MCP docs because the Markdown
tables were not padded the way the repository's formatter expects. This is
the output of ./gradlew :spotlessApply and changes only whitespace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant