Skip to content

Passing arguments to my console application #87

@martinmoose

Description

@martinmoose

How can I access command-line arguments (like --token) passed to my MCP server in the JSON configuration? I'm setting up a tool with "args": ["--token", "my-token-value"] in the config, but I'm not sure how to retrieve these arguments in my C# implementation. I've successfully implemented the static class example from the readme and it works fine in Claude, but I'm struggling to figure out how to pass the token argument from the JSON config into my tool. Is there a recommended pattern for accessing these values in my tool handlers? I'm a bit new to this, so any guidance would be appreciated

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions