Skip to content

Conversation

@valayDave
Copy link
Contributor

Calling the CLI like below command doesn't end up working:

fastmcp install claude-code "$SERVER_FILE" \
    --python 3.12 \
    --env "DOCS_DIR=$DOCS_DIR" \
    --env "ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY" \
    --with fastmcp \
    --with anthropic \
    --with click

It errors out like:

Failed to install 'foo-mcp' in Claude Code: Invalid environment variable format: foo-mcp, environment variables should be added as: -e KEY1=value1 
-e KEY2=value2

The fix was simply ensuring that the claude code mcp command gets mcp name directly.

Description

Contributors Checklist

  • My change closes #(issue number)
  • I have followed the repository's development workflow
  • I have tested my changes manually
  • I have performed all required documentation updates

Review Checklist

  • I have self-reviewed my changes
  • My Pull Request is ready for review

Calling the CLI like below command doenst end up working: 

```
fastmcp install claude-code "$SERVER_FILE" \
    --python 3.12 \
    --env "DOCS_DIR=$DOCS_DIR" \
    --env "ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY" \
    --with fastmcp \
    --with anthropic \
    --with click
```

It errors out like: 

```
Failed to install 'foo-mcp' in Claude Code: Invalid environment variable format: foo-mcp, environment variables should be added as: -e KEY1=value1 
-e KEY2=value2
```

The fix was simply ensuring that the claude code mcp command gets mcp name directly.
@marvin-context-protocol marvin-context-protocol bot added bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. cli Related to FastMCP CLI commands (run, dev, install) or CLI functionality. labels Oct 21, 2025
Copy link
Owner

@jlowin jlowin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching! In the future, please open an issue first and close it with a PR rather than reporting the issue in the PR.

@jlowin jlowin merged commit 19e9745 into jlowin:main Oct 21, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working. Reports of errors, unexpected behavior, or broken functionality. cli Related to FastMCP CLI commands (run, dev, install) or CLI functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants