-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add MCP server #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Add MCP server #70
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
5e8ba5a
Add MCP server
codingjoe 996e93f
feat: add MCP server with connect_rtp/connect_sip factory functions
Copilot d18b3a9
refactor: rename rtp_bind to rtp_bind_address, add env-var helpers to…
Copilot fedc2d0
refactor: replace connect_rtp/connect_sip with single run(), remove r…
Copilot a0662e2
Refactor
codingjoe 91856a2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1c1dd85
complete: fix CI, dialog.session, MCPAgentCall, tool fixes, tests
Copilot 66b27e2
fix: add error handling for uninitialized connection_pool.sip
Copilot 07a1a77
Apply suggestions from code review
codingjoe 7884cc1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c60422a
Address review comments
codingjoe e77b551
Wrap parser
codingjoe f628fbb
fix: await registered_event in SessionInitiationProtocol.run()
Copilot 158a9e0
docs: improve run() docstring for fn and dialog_class parameters
Copilot 2dc3ba1
update docs
codingjoe 6ca06de
Improve docs
codingjoe ff3aa36
Set min fastmcp version to support docstring args extraction
codingjoe 2f72214
Update docs
codingjoe 7e731dd
Add type
codingjoe 0785eaf
Improve docs
codingjoe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # MCP Server | ||
|
|
||
| The `voip` package ships a ready-made [Model Context Protocol (MCP)][MCP] server that exposes | ||
| two tools — `say` and `call` — so that any MCP-compatible AI client (e.g. Claude Desktop) | ||
| can make phone calls on your behalf. | ||
|
|
||
| [MCP]: https://modelcontextprotocol.io/ | ||
|
|
||
| ## Installation | ||
|
|
||
| ```console | ||
| pip install voip[mcp] | ||
| ``` | ||
|
|
||
| ## Starting the server | ||
|
|
||
| The server is available as a CLI command. Pass the SIP address-of-record (AOR) either as a | ||
| positional argument or via the `SIP_AOR` environment variable: | ||
|
|
||
| ```console | ||
| voip mcp sip:alice@provider.example --transport stdio | ||
| # or | ||
| SIP_AOR=sip:alice@provider.example voip mcp --transport http | ||
| ``` | ||
|
|
||
| | Variable | Default | Description | | ||
| |---------------------|----------------------------|--------------------------------------------------| | ||
| | `SIP_AOR` | *(required)* | SIP address-of-record for registration. | | ||
| | `STUN_SERVER` | `stun.cloudflare.com:3478` | STUN server used for RTP NAT traversal. | | ||
| | `SIP_NO_VERIFY_TLS` | unset | Set to `1` to disable TLS certificate checks. | | ||
|
|
||
| ## Tools | ||
|
|
||
| ::: voip.mcp.say | ||
|
|
||
| ::: voip.mcp.call | ||
|
|
||
| ## Transport factory functions | ||
|
|
||
| The two factory functions below are the public building blocks used by the MCP tools. | ||
| They follow the same **start-and-block** pattern as | ||
| [`mcp.run`][fastmcp.FastMCP.run]: call them with the desired parameters and they handle | ||
| the full connection lifecycle internally. | ||
|
|
||
| ::: voip.mcp.connect_rtp | ||
|
|
||
| ::: voip.mcp.connect_sip | ||
|
|
||
| ## Environment variable helpers | ||
|
|
||
| ::: voip.mcp.read_aor | ||
|
|
||
| ::: voip.mcp.read_stun_server | ||
|
|
||
| ## Session classes | ||
|
|
||
| ::: voip.mcp.HangupDialog | ||
|
|
||
| ::: voip.mcp.MCPAgentCall | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.