diff --git a/src/main/kotlin/net/portswigger/mcp/tools/Tools.kt b/src/main/kotlin/net/portswigger/mcp/tools/Tools.kt index 5443eb6..1b4f1d2 100644 --- a/src/main/kotlin/net/portswigger/mcp/tools/Tools.kt +++ b/src/main/kotlin/net/portswigger/mcp/tools/Tools.kt @@ -255,6 +255,15 @@ fun Server.registerTools(api: MontoyaApi, config: McpConfig) { .map { truncateIfNeeded(Json.encodeToString(it.toSerializableForm())) } } + mcpTool("Display single item within the proxy HTTP history by the specified index.") { + val requestResponse = api.proxy().history().getOrNull(index - 1) + if (requestResponse == null) { + "No HTTP history found at $index" + } else { + truncateIfNeeded(Json.encodeToString(requestResponse.toSerializableForm())) + } + } + mcpPaginatedTool("Displays items within the proxy WebSocket history") { val allowed = runBlocking { checkHistoryPermissionOrDeny(HistoryAccessType.WEBSOCKET_HISTORY, config, api, "WebSocket history") @@ -411,6 +420,9 @@ data class GetProxyHttpHistory(override val count: Int, override val offset: Int @Serializable data class GetProxyHttpHistoryRegex(val regex: String, override val count: Int, override val offset: Int) : Paginated +@Serializable +data class GetProxyHttpHistoryIndex(val index: Int) + @Serializable data class GetProxyWebsocketHistory(override val count: Int, override val offset: Int) : Paginated