Commit Graph

8 Commits

Author SHA1 Message Date
Namhyeon, Go
f1456e304c Add tools call handling and translate docs
Pass the serializer and request id to ResolveToolsCall and implement a basic dispatcher that extracts params.method. Add a handler stub for "run_jsrt_script" (extracts the script argument; implementation TODO) and log unknown tool methods. Also update McpToolsList.json scriptContract notes from Korean to English to improve readability/localization.
2026-03-16 21:37:16 +09:00
Namhyeon, Go
3eea89f5a3 Fix JSON-RPC dispatcher callback params
Reordered the parameters for the JSON-RPC dispatch callback to ensure the serializer and request id are passed in the correct positions. Updated the Func signature in JsonRpc2Dispatcher.cs to include the int id parameter before the CancellationToken, and adjusted the invocation/lambda in JsonRpc2.cs to match (method, ser, id, ct), preventing parameter mismatches when handling requests.
2026-03-16 21:17:51 +09:00
d7f58a9b0c Propagate request id and add tools call handler
Forward the JSON-RPC request id through the dispatcher and handler so methods can access the id. JsonRpc2Dispatcher now passes the id to dispatchMethodAsync, and the JsonRpc2 endpoint lambda accepts the id parameter. Implemented a call for "tools/call" that extracts the tool name via ser.ExtractFrom(id, "params", "name") and invokes a new ResolveToolsCall(string) stub (TODO: implement actual tool logic). This prepares the codepath for tooling invocation based on request params.
2026-03-07 14:44:14 +09:00
6b3d83fbcd Add JSON-RPC2 stdio & HTTP endpoint support
Introduce JSON-RPC 2.0 handling and a minimal stdio framing server. Adds ApiEndpoints/JsonRpc2 and JsonRpc2Dispatcher to parse and dispatch JSON-RPC requests, and StdioServer to handle Content-Length framed stdio messages. Adds McpToolsList.json (tools list resource) and wires JsonRpc2 into ResourceServer.

Program.cs: add --stdio-jsonrpc2 mode to run the stdio server, and integrate dispatcher usage (with timeout and TODO placeholders for tools/call). ResourceServer: register JsonRpc2 endpoint, change fallback handling to 404 via ServeResource(), and make several resource helper methods static/public for reuse. Update csproj to include new source files and embed the McpToolsList.json resource.

Contains basic implementation and scaffolding; tool-call handling is left as TODO.
2026-02-05 17:44:39 +09:00
Namhyeon, Go
7b2a2d49d0 Move API endpoints to ApiEndpoints namespace
Refactored all API endpoint classes from the ResourceTools namespace to the ApiEndpoints namespace for improved clarity and organization. Updated all references in ResourceServer to use the new namespace.
2026-01-31 23:26:36 +09:00
Namhyeon, Go
c98fcfea10 Add null checks for path in API endpoint handlers
Added null checks for the 'path' parameter in CanHandle methods across all API endpoint classes to prevent potential NullReferenceExceptions. Also made the _apis list in ResourceServer readonly and updated a comment for clarity.
2026-01-31 23:21:53 +09:00
Namhyeon, Go
741ade67c3 Refactor CanHandle to accept HttpListenerContext
Updated the IApiEndpoint interface and all implementing endpoints to change the CanHandle method signature to accept both HttpListenerContext and path. This enables more advanced routing decisions based on the full HTTP request context. ResourceServer and all endpoint usages have been updated accordingly.
2026-01-31 23:17:33 +09:00
96986d1417 Migrate logging to log4net and refactor API endpoints
Replaces the custom ICompatibleLogger and TraceLogger with log4net for logging, introducing LoggingBootstrap for environment-aware log4net initialization. Refactors all resource tools to use IApiEndpoint and moves them to the ApiEndpoints namespace. Updates project references, configuration, and adds a log4net.config for consistent logging setup.
2026-01-26 14:51:12 +09:00