Skip to content

Conversation

@praskr-wisdom
Copy link

@praskr-wisdom praskr-wisdom commented Jan 26, 2026

Fixes #857

Summary

Cursor uses ${env:VARIABLE_NAME} syntax while Claude Code uses ${VARIABLE_NAME} for environment variable references in MCP configurations. This adds automatic transformation between formats.

Changes

  • Add env-var-utils.ts with conversion functions
  • Modify cursor-mcp.ts to transform env values in fromRulesyncMcp() and toRulesyncMcp()
  • Add unit and integration tests

Testing

pnpm test src/features/mcp/cursor-mcp.test.ts

@praskr-wisdom praskr-wisdom force-pushed the fix/cursor-env-var-syntax-857 branch from 75996fb to 5580288 Compare January 26, 2026 17:28
Fixes dyoshikawa#857

Cursor uses ${env:VARIABLE_NAME} syntax while Claude Code uses ${VARIABLE_NAME}
for environment variable references in MCP configurations. This change adds automatic
transformation between these formats during MCP config generation and import.

- Add private convertEnvFromCursorFormat() and convertEnvToCursorFormat() functions
- Transform env values in fromRulesyncMcp() and toRulesyncMcp() methods
- Add comprehensive integration tests
@praskr-wisdom praskr-wisdom force-pushed the fix/cursor-env-var-syntax-857 branch from 5580288 to 180f32f Compare January 26, 2026 17:30
@praskr-wisdom praskr-wisdom marked this pull request as ready for review January 26, 2026 17: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.

mcp.json env handling in cursor vs claude code

1 participant