Skip to content

[docs] How to run FastMCP with args or env vars? #339

Open

Description

@exeex

https://github.com/modelcontextprotocol/python-sdk/tree/main?tab=readme-ov-file#development-mode

# Development Mode
The fastest way to test and debug your server is with the MCP Inspector:

mcp dev server.py

# Add dependencies
mcp dev server.py --with pandas --with numpy

# Mount local code
mcp dev server.py --with-editable .

This didn't show how to run with args in dev mode.
Expected to see something like this:

mcp install server.py -v API_KEY=abc123 -v DB_URL=postgres://...
mcp install server.py -f .env

However this is not dev mode

Activity

  1. thadanguyen commented on Aug 3, 2025

    @thadanguyen

    +1, --help also shows no possible options to add args. I think this is a missing feature. For env vars, you could walk-around by using .env then load it in the script, but for args, it is not possible yet.

  2. added
    documentationImprovements or additions to documentation
    ready for workEnough information for someone to start working on
    P2Moderate issues affecting some users, edge cases, potentially valuable feature
    on Oct 7, 2025
  3. felixweinberger commented on Oct 7, 2025

    @felixweinberger
    Contributor

    More support for expanded CLI docs

  4. looney-blooper commented on Jul 20, 2026

    @looney-blooper

    yelo! I'd like to work on this if it's available.

    I noticed the v2 MCP development documentation could use a bit more clarity around how mcp dev behaves. My plan is to update docs/run/index.md to mention that it:

    • inherits environment variables from the invoking shell,
    • supports --with and --with-editable for dependencies,
    • and doesn't forward arbitrary arguments to the server.

    I'll keep the scope limited to documentation only. If that sounds good, I'd be happy to take this on. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featuredocumentationImprovements or additions to documentationready for workEnough information for someone to start working on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions