Commit Graph

9 Commits

Author SHA1 Message Date
hanishkvc f75f93f8d9 SimpleSallap:SimpleMCP:SendMcp expects dataclass and uses asdict 2025-12-07 19:36:07 +05:30
hanishkvc bc9dd580b9 SimpleSallap:SimpleMCP:InitalGoCleanup Limit read to ContentLength
Also enforce need for kind of a sane Content-Length header entry
in our case. NOTE: it does allow for 0 or other small content lengths,
which isnt necessarily valid.
2025-12-07 18:47:22 +05:30
hanishkvc e9dbe21c67 SimpleSallap:SimpleMCP:Cleanup initial go by running and seeing
As expected dataclass field member mutable default values needing
default_factory.

Dont forget returning after sending error response.

TypeAlias type hinting flow seems to go beyond TYPE_CHECKING.
Also email.message.Message[str,str] not accepted, so keep things
simple wrt HttpHeaders for now.
2025-12-07 03:19:22 +05:30
hanishkvc 79cfbbfc8a SimpleSallap:SimpleMCP:Allow auth check to be bypassed, if needed
By default bearer based auth check is done always whether in https
or http mode. However by updating the sec.bAuthAlways config entry
to false, the bearer auth check will be carried out only in https
mode.
2025-12-07 02:34:05 +05:30
hanishkvc 9d6daaed8c SimpleSallap:SimpleMCP:Body Bytes to Json within mcp_run
Given that there could be other service paths beyond /mcp exposed
in future, and given that it is not necessary that their post body
contain json data, so move conversion to json to within mcp_run
handler.

While retaining reading of the body in the generic do_POST ensures
that the read size limit is implicitly enforced, whether /mcp now or
any other path in future.
2025-12-07 02:28:49 +05:30
hanishkvc fac947f9cd SimpleSallap:SimpleMCP:tools/list
Fix a oversight wrt ToolManager.meta, where I had created a dict
of name-keyed toolcall metas, instead of a simple list of toolcall
metas. Rather I blindly duplicated structure I used for storing the
tool calls in the tc_switch in the anveshika sallap client side
code.

Add dataclasses to mimic the MCP tools/list response. However wrt
the 2 odd differences between the MCP structure and OpenAi tools
handshake structure, for now I have retained the OpenAi tools hs
structure.

Add a common helper send_mcp to ProxyHandler given that both
mcp_toolscall and mcp_toolslist and even others like mcp_initialise
in future require a common response mechanism.

With above and bit more implement initial go at tools/list response.
2025-12-07 00:29:37 +05:30
hanishkvc 69be7f2029 SimpleSallap:SimpleMCP: Use ToolManager for some of needed logics
Build the list of tool calls

Trap some of the MCP post json based requests and map to related
handlers. Inturn implement the tool call execution handler.

Add some helper dataclasses wrt expected MCP response structure

TOTHINK: For now maintain id has a string and not int, with idea
to map it directly to callid wrt tool call handshake by ai model.

TOCHECK: For now suffle the order of fields wrt jsonrpc and type
wrt MCP response related structures, assuming the order shouldnt
matter. Need to cross check.
2025-12-06 23:48:58 +05:30
hanishkvc 0a445c875b SimpleSallap:SimpleMCP:Move towards post json based flow 2025-12-06 19:46:48 +05:30
hanishkvc 1db3a80f40 SimpleSallap:SimpleMCP:Duplicate simpleproxy for mcpish handshake
Will be looking at changing the handshake between AnveshikaSallap
web tech based client logic and this tool calls server to follow
the emerging interoperable MCP standard
2025-12-06 18:29:39 +05:30