[no-ci] chore: add Context7 MCP server configuration#686
[no-ci] chore: add Context7 MCP server configuration#686lukeocodes wants to merge 3 commits intomainfrom
Conversation
Control messages (keep-alive, close-stream, finalize, flush, clear, close) carry no meaningful payload — the type field is the whole message. Making the message param optional with a typed default means users can call e.g. send_keep_alive() without constructing the type themselves. Payload-carrying methods (send_text, send_media, send_settings, etc.) remain required. This restores behaviour lost in the last regen and fixes a breaking change shipped in a minor patch.
Also fixes AgentV1KeepAlive default to include type='KeepAlive' (bare AgentV1KeepAlive() fails Pydantic validation since type is required).
There was a problem hiding this comment.
Pull request overview
This PR introduces a new MCP configuration file for Context7 (documentation lookup) and also restores backwards-compatible no-argument behavior for several WebSocket control send_* methods, with regression tests to prevent future generator regressions.
Changes:
- Add
.mcp.jsonwith Context7 (remote) and deepgram-styles (stdio) MCP server configs. - Make several WebSocket control-message
send_*methods accept an optional message param (defaulting to a minimal control payload when omitted). - Add regression tests covering no-arg control-message sends across speak/listen/agent socket clients.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/custom/test_websocket_control_messages.py |
New regression tests ensuring control send_* methods work without providing a message object. |
src/deepgram/speak/v1/socket_client.py |
Allow no-arg send_flush/clear/close by defaulting to minimal control models. |
src/deepgram/listen/v1/socket_client.py |
Allow no-arg send_finalize/close_stream/keep_alive by defaulting to minimal control models. |
src/deepgram/listen/v2/socket_client.py |
Allow no-arg send_close_stream by defaulting to a minimal control model. |
src/deepgram/agent/v1/socket_client.py |
Allow no-arg send_keep_alive by defaulting to a minimal control model. |
.mcp.json |
New MCP server configuration (Context7 + deepgram-styles). |
.fernignore |
Notes explaining why WebSocket socket clients are ignored/frozen from regeneration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| "mcpServers": { | ||
| "context7": { | ||
| "type": "remote", | ||
| "url": "https://context7.com/deepgram/deepgram-python-sdk", | ||
| "env": { |
There was a problem hiding this comment.
The PR title/description indicate this change is only adding Context7 MCP server configuration, but this PR also modifies multiple WebSocket socket clients and adds new regression tests. Please update the PR description/title to reflect the behavior change (optional control-message params) or split this into separate PRs to keep the change scope clear.
| "type": "remote", | ||
| "url": "https://context7.com/deepgram/deepgram-python-sdk", | ||
| "env": { | ||
| "CONTEXT7_PUBLIC_KEY": "pk_hu7APZeIXQ14hNyaCBm0A" |
There was a problem hiding this comment.
Avoid committing API keys (even if labeled "public") directly into the repository. Consider removing the hard-coded CONTEXT7_PUBLIC_KEY value and instead reading it from the developer environment (or providing a .mcp.example.json / documentation indicating the required env var). This reduces the risk of unintended key reuse/abuse and makes rotation easier.
| "CONTEXT7_PUBLIC_KEY": "pk_hu7APZeIXQ14hNyaCBm0A" | |
| "CONTEXT7_PUBLIC_KEY": "${CONTEXT7_PUBLIC_KEY}" |
Adds Context7 MCP server configuration to enable documentation lookups for the Python SDK.\n\nThis is a non-release change (marked [no-ci] to prevent release-please from triggering).