Commit Graph

12966 Commits

Author SHA1 Message Date
ryoppippi
b060d3fca0 test(mcp-inspector): add connection persistence test script
- Create test script to verify WebSocket connections persist across requests

- Test multiple sequential MCP requests using the same inspector URL

- Demonstrate that connections are maintained in the worker thread
2025-07-11 16:36:32 -07:00
ryoppippi
f059093302 fix(mcp-inspector): update MCP handlers for async state retrieval
- Convert synchronous Map.get() calls to async function calls

- Update imports to include new async getter functions

- Remove manual heap snapshot storage (now handled in worker)
2025-07-11 16:36:03 -07:00
ryoppippi
b78afcff49 refactor(mcp-inspector): migrate to worker-based architecture with birpc
- Replace direct WebSocket management with worker delegation

- Use birpc for type-safe RPC calls to worker functions

- Convert state maps to async getter functions

- Maintain backward compatibility with existing API
2025-07-11 16:35:51 -07:00
ryoppippi
02ab90ed60 feat(mcp-inspector): implement worker for persistent WebSocket connections
- Create dedicated worker thread to manage inspector connections

- Implement birpc-based RPC communication between main and worker threads

- Store inspector state (call frames, console messages, heap snapshots, etc.) in worker

- Handle all WebSocket events in worker to maintain connection persistence
2025-07-11 16:35:38 -07:00
ryoppippi
736bff900c deps(mcp-inspector): add birpc for bidirectional RPC communication 2025-07-11 16:35:24 -07:00
ryoppippi
cf2b881b52 docs(mcp-inspector): enhance CLAUDE.md with comprehensive documentation
- Add project overview with key capabilities

- Add quick start guide with installation and usage examples

- Add Claude Desktop integration instructions

- Expand architecture section with detailed component descriptions

- Document all 32 MCP tools organized by category with inputs/outputs

- Add protocol integration details with specific domains

- Include TypeScript code examples for type safety and error handling

- Add common use cases for debugging, memory profiling, and performance analysis

- Add troubleshooting guide for connection and event issues

- Improve overall structure and readability for developers
2025-07-11 16:12:06 -07:00
ryoppippi
6dde600b28 chore(mcp): fix mcp inspector 2025-07-11 16:12:06 -07:00
ryoppippi
3150b15356 feat(mcp): convert to http streamable mcp server 2025-07-11 16:03:59 -07:00
ryoppippi
5da217802f fix(mcp): add http stream app 2025-07-11 15:58:31 -07:00
ryoppippi
21a04a1849 fix(mcp): types 2025-07-11 15:56:42 -07:00
ryoppippi
004ea97e58 chore: add hono and mcp sdk in deps 2025-07-11 15:51:20 -07:00
ryoppippi
3fd6a2eb97 fix(mcp): return type of Runtime.awaitPromise 2025-07-11 15:42:49 -07:00
ryoppippi
4245147fe9 fix(mcp): remove outputSchema from getConsoleMessages 2025-07-11 15:34:33 -07:00
ryoppippi
986fc121ef fix(mcp): console.info -> warn 2025-07-11 15:32:32 -07:00
ryoppippi
3d3badb4bc fix(mcp): update inspect script to run index.ts
Added bun index.ts argument to mcp-inspector command
2025-07-11 15:29:18 -07:00
ryoppippi
ed22ca67d8 chore(mcp): add mcp-inspector tool and update dependencies
Added @modelcontextprotocol/inspector as dev dependency

Updated inspect script to use mcp-inspector instead of generic inspector

Added DANGEROUSLY_OMIT_AUTH flag for local development
2025-07-11 15:27:54 -07:00
ryoppippi
9df7b78793 docs(mcp): update CLAUDE.md with new MCP tools
Added documentation for debugger control flow tools

Added documentation for Runtime object inspection tools

Reorganized tool listings into logical groups
2025-07-11 15:27:40 -07:00
ryoppippi
7e76521c57 feat(mcp): add Runtime object inspection tools
Added Runtime.getProperties for inspecting object properties

Added Runtime.callFunctionOn for executing functions on objects

Added Runtime.awaitPromise for handling async debugging
2025-07-11 15:25:25 -07:00
ryoppippi
ef38f27ac4 refactor(mcp): remove duplicate memory profiler MCP server
Consolidated memory profiling functionality into main MCP server

Removed memory-mcp.ts, memory-index.ts, and memory-profiler.ts

Updated package.json to remove build:memory script
2025-07-11 15:23:32 -07:00
ryoppippi
33a3d28336 feat(mcp): add debugger control flow tools
Added pause/resume commands for manual debugger control

Added step debugging methods (stepInto, stepOver, stepOut)

Added continueToLocation for targeted debugging

Added setPauseOnExceptions for exception handling

Added evaluateOnCallFrame for context-aware evaluation
2025-07-11 15:22:03 -07:00
ryoppippi
2074253f3b docs(mcp): add reference to Bun LLM documentation 2025-07-11 15:16:19 -07:00
ryoppippi
c14e94111f fix(mcp): correct heap snapshot types in memory profiler
- Change heapSnapshotsMap to use JSC.Heap.SnapshotResponse type
- Fix TrackingStartEvent and TrackingCompleteEvent handlers
- Use correct property names (timestamp, snapshotData)
2025-07-11 15:15:33 -07:00
ryoppippi
da6f88b80b feat(mcp): add memory profiler entry point and build script
- Create memory-index.ts as entry point for memory MCP server
- Add build:memory script to package.json for building memory profiler
2025-07-11 15:13:18 -07:00
ryoppippi
0853270f75 feat(mcp): add memory profiling infrastructure
- Create WebSocketInspector-based memory profiler module
- Add state management for heap snapshots and GC events
- Add CPU profiling event handlers
- Create MCP server infrastructure for memory profiling tools
2025-07-11 15:12:46 -07:00
ryoppippi
260bfe8f86 feat(mcp): add memory and CPU profiling tools
Add comprehensive memory profiling capabilities through Heap domain:

- Heap.enable/disable for enabling heap profiling events

- Heap.snapshot for taking heap memory snapshots

- Heap.gc for triggering garbage collection

- Heap.startTracking/stopTracking for tracking heap changes

- Heap.getPreview/getRemoteObject for inspecting heap objects

- Helper tools: getHeapSnapshots, getGCEvents

Add CPU profiling capabilities through ScriptProfiler domain:

- ScriptProfiler.startTracking/stopTracking with optional sampling

- getCPUProfiles helper for retrieving collected profiles

Update state management to track:

- Heap snapshots per URL

- Garbage collection events per URL

- CPU profiling data per URL

Also add index.js to .gitignore as it is a build artifact
2025-07-11 15:11:22 -07:00
ryoppippi
e0b2e7dbd1 feat(mcp): add debugger breakpoint management tools
- Add Debugger.setBreakpointByUrl to set breakpoints by file URL

- Add Debugger.setBreakpoint to set breakpoints by script ID

- Add Debugger.removeBreakpoint to remove breakpoints

- Add Debugger.setBreakpointsActive to toggle all breakpoints

- All tools include proper error handling and type assertions
2025-07-11 14:59:21 -07:00
ryoppippi
007055dfc1 feat(mcp): add getConsoleMessages tool
Retrieves buffered console messages from the inspector

Returns messages with timestamps in ISO format
2025-07-11 14:58:42 -07:00
ryoppippi
818632c4b8 feat(mcp): add Debugger.getScriptSource tool
Allows retrieving source code of a script by its ID
2025-07-11 14:58:21 -07:00
ryoppippi
d37a2a24e5 fix(mcp): add type assertions and import console/callFrame maps
- Import consoleMessagesMap and callFramesMap from inspector

- Add as const type assertions for MCP content type fields

- Fixes TypeScript type inference issues with MCP SDK
2025-07-11 14:57:56 -07:00
ryoppippi
81ead7d867 feat(mcp): enable debugger and add event handlers in inspector
- Automatically enable debugger on connection

- Add callFramesMap to store paused call frames by URL

- Add consoleMessagesMap to buffer console messages by URL

- Listen for Debugger.paused events and store call frames

- Listen for Console.messageAdded events and buffer messages

- Import JSC types and remoteObjectToString utility
2025-07-11 14:56:29 -07:00
ryoppippi
d044fc33da docs(mcp): document new debugger tools in CLAUDE.md
- Add documentation for Debugger.setBreakpointByUrl

- Add documentation for Debugger.setBreakpoint

- Add documentation for Debugger.removeBreakpoint

- Add documentation for Debugger.setBreakpointsActive

- Update flow to mention automatic debugger enabling

- Add notes about server.registerTool() vs server.tool()

- Add note about type assertions for zod-parsed inputs
2025-07-11 14:56:12 -07:00
ryoppippi
ca236ae967 docs(mcp): add CLAUDE.md 2025-07-11 14:45:25 -07:00
ryoppippi
eacc0e7d77 chore(mcp): ignore bun-inspector-protocol typecheck 2025-07-11 14:41:07 -07:00
ryoppippi
24bc4d86d7 chore(mcp): accept url dynamically 2025-07-11 14:41:07 -07:00
ryoppippi
c79aaf5520 feat(mcp): inital prototype 2025-07-11 13:13:38 -07:00
ryoppippi
4480ce6685 chore(mcp): add deps 2025-07-11 13:13:23 -07:00
ryoppippi
16cf7b25be chore(mcp): add bun-inspector-protocol 2025-07-11 12:27:09 -07:00
ryoppippi
5c754773c7 chore(mcp): init 2025-07-11 12:24:34 -07:00
ryoppippi
423da1e4d3 chore: init 2025-07-11 12:21:06 -07:00
Meghan Denny
9bc559e09f console: fix printing of Response(Bun.file()) (#20933) 2025-07-11 11:37:44 -07:00
Alistair Smith
c82e4fb485 fix typo (#20962) 2025-07-10 22:57:14 -07:00
Alistair Smith
a8780632a6 fix typo 2025-07-10 22:56:21 -07:00
Alistair Smith
65ccb39778 Convert bun-types.test.ts to TS compiler api, fix forward-declared empty interfaces (#20960) 2025-07-10 22:47:42 -07:00
Jarred Sumner
ac55376161 [ci] Don't error if machine hits permission error when modifying coredump settings 2025-07-10 21:32:40 -07:00
Jarred Sumner
5bde8a6c3b Include an Error object in WebSocket error event dispatch (#20957) 2025-07-10 21:28:03 -07:00
Zack Radisic
d733a96ba7 Add LLDB pretty printing for bun.BabyList (#20958)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-07-10 21:27:03 -07:00
190n
650c8f6d60 cmake: do not accept too-new LLVM versions (#20955) 2025-07-10 18:20:51 -07:00
Alistair Smith
6a62784e89 fix(types): Non-empty TextDecoderStream and TextEncoderStream when outside DOM (#20953) 2025-07-10 17:48:45 -07:00
Meghan Denny
6c5b863530 safety: a lot more exception checker progress (#20817) 2025-07-10 15:34:51 -07:00
taylor.fish
c6bce38ead Fix incorrect negation of isEmpty() in assertion (#20952) 2025-07-10 15:34:46 -07:00