MCPcopy Index your code
hub / github.com/plotly/dash / _json_response

Function _json_response

dash/mcp/_server.py:101–115  ·  view source on GitHub ↗

Wrap one or more JSON-RPC messages in a response. A single message is serialised as a JSON object; multiple messages are serialised as a JSON array.

(*messages: dict)

Source from the content-addressed store, hash-verified

99 return False
100
101 def _json_response(*messages: dict):
102 """Wrap one or more JSON-RPC messages in a response.
103
104 A single message is serialised as a JSON object; multiple
105 messages are serialised as a JSON array.
106 """
107 body = messages[0] if len(messages) == 1 else list(messages)
108 resp = app.backend.make_response(
109 json.dumps(body),
110 content_type="application/json",
111 status=200,
112 )
113 if _session_id is not None:
114 resp.headers["Mcp-Session-Id"] = _session_id
115 return resp
116
117 def _handle_post() -> Any:
118 adapter = app.backend.request_adapter()

Callers 1

_handle_mcp_requestFunction · 0.85

Calls 1

make_responseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…