Skip to content

[no-ci] chore: add Context7 MCP server configuration#686

Closed
lukeocodes wants to merge 3 commits intomainfrom
chore/add-context7-config
Closed

[no-ci] chore: add Context7 MCP server configuration#686
lukeocodes wants to merge 3 commits intomainfrom
chore/add-context7-config

Conversation

@lukeocodes
Copy link
Copy Markdown
Member

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).

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).
Copilot AI review requested due to automatic review settings April 11, 2026 08:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json with 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.

Comment on lines +1 to +6
{
"mcpServers": {
"context7": {
"type": "remote",
"url": "https://context7.com/deepgram/deepgram-python-sdk",
"env": {
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
"type": "remote",
"url": "https://context7.com/deepgram/deepgram-python-sdk",
"env": {
"CONTEXT7_PUBLIC_KEY": "pk_hu7APZeIXQ14hNyaCBm0A"
Copy link

Copilot AI Apr 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"CONTEXT7_PUBLIC_KEY": "pk_hu7APZeIXQ14hNyaCBm0A"
"CONTEXT7_PUBLIC_KEY": "${CONTEXT7_PUBLIC_KEY}"

Copilot uses AI. Check for mistakes.
@lukeocodes lukeocodes closed this Apr 11, 2026
@lukeocodes lukeocodes deleted the chore/add-context7-config branch April 11, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants