Appearance
Tool Allow-Listing Fresh
By default, XMCP exposes all X API operations as tools. The X_API_TOOL_ALLOWLIST environment variable restricts which operations are available - the single most important control for limiting what an AI agent can do.
Why allow-list
flowchart TD
A[XMCP starts] --> B{X_API_TOOL_ALLOWLIST set?}
B -->|No| C[All 200+ operations become tools]
B -->|Yes| D[Only listed operations become tools]
C --> E[Agent can read AND write everything]
D --> F[Agent limited to the allow-list]A focused allow-list lets you, for example, grant read-only access while blocking post creation or deletion. This is the recommended posture for any agent you do not fully trust.
How to set it
Add a comma-separated list of operation names to your .env:
bash
X_API_TOOL_ALLOWLIST="createPosts,getUsersByUsername,searchPostsRecent,likePost"Applied at startup
The allow-list is applied when the OpenAPI spec loads, so restart the server after changing it.
Common allow-list recipes
Read-only research agent
bash
X_API_TOOL_ALLOWLIST=getUsersByUsername,getUsersById,searchPostsRecent,getPostsById,getUsersPostsPosting / engagement agent
bash
X_API_TOOL_ALLOWLIST=createPosts,likePost,repostPost,getUsersMe,searchPostsRecentList management agent
bash
X_API_TOOL_ALLOWLIST=createLists,updateLists,addListsMember,removeListsMemberByUserId,getListsMembersMinimal smoke test
bash
X_API_TOOL_ALLOWLIST=getUsersByUsername,createPosts,searchPostsRecentPicking operation names
Every allow-list entry is an operation name from the OpenAPI spec - the same names XMCP uses to generate tools. Browse the full set in the Tool Catalog, grouped by resource (Posts, Users, Lists, Direct Messages, Media, Spaces, and more).
A few high-traffic examples:
| Operation | What it does |
|---|---|
createPosts | Create a post |
deletePosts | Delete a post |
searchPostsRecent | Search posts from the last 7 days |
getUsersByUsername | Look up a user by handle |
getUsersMe | Get the authenticated user |
likePost / unlikePost | Like / unlike a post |
repostPost / unrepostPost | Repost / undo repost |
followUser / unfollowUser | Follow / unfollow |
Verification checklist
- [ ]
X_API_TOOL_ALLOWLISTset with valid operation names - [ ] Server restarted after the change
- [ ] Client now lists only the allowed tools
- [ ] Write operations excluded if a read-only posture was intended