Skip to content

Commit 159b184

Browse files
committed
Updates to signature generation
1 parent e27659b commit 159b184

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

mcp-server/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ The sample code below assuming that the following environment variables are set:
8585
* TWILIO_AUTH_TOKEN
8686
* TWILIO_BASE_DOMAIN
8787

88+
ℹ️ As the generated signature depends on the full Function endpoint that you are executing, and the URL includes the set of services (e.g. `/mcp?services=PhoneNumbers` vs `/mcp?services=Messaging`), you will need to generate a valid signature every time you update any part of the URL. We recommend dynamically generating the signature whenever you initialize the MCP client configuration with your Twilio MCP server.
89+
8890
#### JavaScript
8991

9092
```javascript
@@ -109,7 +111,7 @@ function getSignature(authToken, url, params) {
109111
const signature =
110112
twilio.getExpectedTwilioSignature(
111113
process.env.TWILIO_AUTH_TOKEN,
112-
`${process.env.TWILIO_DOMAIN_NAME}/mcp`,
114+
`${process.env.TWILIO_DOMAIN_NAME}/mcp?services=...`,
113115
{}
114116
);
115117
```
@@ -125,7 +127,7 @@ dotenv.config();
125127
const signature =
126128
twilio.getExpectedTwilioSignature(
127129
process.env.TWILIO_AUTH_TOKEN,
128-
`${process.env.TWILIO_DOMAIN_NAME}/mcp`,
130+
`${process.env.TWILIO_DOMAIN_NAME}/mcp?services=...`,
129131
{}
130132
);
131133
```
@@ -140,12 +142,12 @@ from twilio.request_validator import RequestValidator
140142
auth_token = os.environ.get("TWILIO_AUTH_TOKEN")
141143
base_domain = os.environ.get("TWILIO_DOMAIN_NAME")
142144

143-
url = f"{base_domain}/mcp?services=Messaging"
145+
url = f"{base_domain}/mcp?services=..."
144146
validator = RequestValidator(auth_token)
145147
signature = validator.compute_signature(url, {})
146148
```
147149

148-
### Services
150+
### Filtering tools by service
149151

150152
Use the querystring parameter `?services=` to specify a set of tools based on the needs of your MCP client. Set multiple services by passing multiple `services` key/value pairs.
151153

0 commit comments

Comments
 (0)