feat(tms): add Contentful2 connector creation tools#101
Draft
Alexandra Cirligeanu (alexandracirligeanu1) wants to merge 4 commits into
Draft
Conversation
Contributor
Tom Doischer (tomdoischer)
left a comment
There was a problem hiding this comment.
Overall the structure and conventions are solid. A few things worth addressing before this graduates from draft — inline comments below.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
New tools:
tms_list_enabled_connector_types — verify CONTENTFUL2 is available for the org
tms_initiate_connector_oauth — generate the Contentful OAuth URL and session uid
tms_poll_connector_auth_code — retrieve the auth code once the user completes browser authorisation
tms_create_connector — create the connector with the OAuth code and payload
tms_test_connector — verify the connection after creation
Authentication flow:
CF2 uses OAuth 2.0 authorization code flow. There is no API token shortcut — browser authorisation is required. The MCP-adapted version of this flow uses three API2 endpoints that all accept bearer tokens (no session cookie needed):
POST /api2/v1/connectors/connectorAuthData → creates state uid
GET /api2/v1/connectorAuthPage/CONTENTFUL2 → returns OAuth URL template
GET /api2/v1/connectors/connectorAuthCode/{uid} → polls for the auth code
Security
No Contentful credentials ever transit the MCP layer — the user authenticates directly with Contentful in their browser
The OAuth code is single-use and short-lived; receiving it via Claude chat is safe
Phrase's backend handles the token exchange and stores the resulting Contentful access token
Related Issue
Testing
npm run buildnpm run lintnpm run format:checknpm run test:coverageChecklist
— added the 5 new tool names to EXPECTED_TOOL_NAMES in tools.test.ts
— connector tools are POC/spike scope
Breaking Changes
New tools only; no existing tools or interfaces modified.