-
Notifications
You must be signed in to change notification settings - Fork 87
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
When I used pipx install mcpm and ran mpc --version, I encountered the following error:
TypeError: cannot specify both default and default_factory
I think this might be a bug. I've tested it on both debian 13 and gentoo and was able to reproduce the issue. How should this be resolved?
What did you expect?
I hope to get help
MCPM Version
2.9.0
OS
Linux
Logs
╭───────────── Traceback (most recent call last) ──────────────╮
│ /home/shenzhe/.local/bin/mcpm:3 in <module> │
│ │
│ 1 #!/home/shenzhe/.local/share/pipx/venvs/mcpm/bin/python │
│ 2 import sys │
│ ❱ 3 from mcpm.cli import main │
│ 4 if __name__ == '__main__': │
│ 5 │ if sys.argv[0].endswith('.exe'): │
│ 6 │ │ sys.argv[0] = sys.argv[0][:-4] │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/mcpm/cli.py:13 in <module> │
│ │
│ 10 from rich.traceback import install as install_rich_tra │
│ 11 │
│ 12 from mcpm.clients.client_config import ClientConfigMan │
│ ❱ 13 from mcpm.commands import ( │
│ 14 │ client, │
│ 15 │ config, │
│ 16 │ doctor, │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/mcpm/commands/__init__.py:25 in <module> │
│ │
│ 22 # All command modules │
│ 23 │
│ 24 │
│ ❱ 25 from . import ( │
│ 26 │ client, │
│ 27 │ config, │
│ 28 │ doctor, │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/mcpm/commands/profile/__init__.py:10 in <module> │
│ │
│ 7 from .inspect import inspect_profile │
│ 8 from .list import list_profiles │
│ 9 from .remove import remove_profile │
│ ❱ 10 from .run import run │
│ 11 from .share import share_profile │
│ 12 │
│ 13 │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/mcpm/commands/profile/run.py:9 in <module> │
│ │
│ 6 from rich.console import Console │
│ 7 from rich.panel import Panel │
│ 8 │
│ ❱ 9 from mcpm.fastmcp_integration.proxy import create_mcpm │
│ 10 │
│ 11 # Removed SessionAction import - using strings directl │
│ 12 from mcpm.profile.profile_config import ProfileConfigM │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/mcpm/fastmcp_integration/proxy.py:8 in <module> │
│ │
│ 5 import logging │
│ 6 from typing import Dict, List, Optional │
│ 7 │
│ ❱ 8 from fastmcp import FastMCP │
│ 9 from fastmcp.utilities.mcp_config import ( │
│ 10 │ MCPConfig, │
│ 11 │ RemoteMCPServer, │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/fastmcp/__init__.py:5 in <module> │
│ │
│ 2 │
│ 3 import warnings │
│ 4 from importlib.metadata import version │
│ ❱ 5 from fastmcp.settings import Settings │
│ 6 │
│ 7 settings = Settings() │
│ 8 │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/fastmcp/settings.py:58 in <module> │
│ │
│ 55 │ env_prefixes: list[str] | None │
│ 56 │
│ 57 │
│ ❱ 58 class Settings(BaseSettings): │
│ 59 │ """FastMCP settings.""" │
│ 60 │ │
│ 61 │ model_config = ExtendedSettingsConfigDict( │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/pydantic/_internal/_model_construction.py:242 in │
│ __new__ │
│ │
│ 239 │ │ │ │
│ 240 │ │ │ ns_resolver = NsResolver(parent_namespace= │
│ 241 │ │ │ │
│ ❱ 242 │ │ │ set_model_fields(cls, config_wrapper=confi │
│ 243 │ │ │ │
│ 244 │ │ │ # This is also set in `complete_model_clas │
│ 245 │ │ │ # We set them here as well for backwards c │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/pydantic/_internal/_model_construction.py:566 in │
│ set_model_fields │
│ │
│ 563 │ │ ns_resolver: Namespace resolver to use when ge │
│ 564 │ """ │
│ 565 │ typevars_map = get_model_typevars_map(cls) │
│ ❱ 566 │ fields, class_vars = collect_model_fields(cls, con │
│ 567 │ │
│ 568 │ cls.__pydantic_fields__ = fields │
│ 569 │ cls.__class_vars__.update(class_vars) │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/pydantic/_internal/_fields.py:364 in │
│ collect_model_fields │
│ │
│ 361 │ │ │ │ assigned_value.default = default │
│ 362 │ │ │ │ assigned_value._attributes_set['defaul │
│ 363 │ │ │ │
│ ❱ 364 │ │ │ field_info = FieldInfo_.from_annotated_att │
│ 365 │ │ │ # Store the original annotation and assign │
│ 366 │ │ │ # Note that the assignment is always store │
│ 367 │ │ │ # parameterized with an unknown forward r │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/pydantic/fields.py:443 in │
│ from_annotated_attribute │
│ │
│ 440 │ │ │ # `default` is the actual default value │
│ 441 │ │ │ attr_overrides['default'] = default │
│ 442 │ │ │
│ ❱ 443 │ │ field_info = FieldInfo._construct( │
│ 444 │ │ │ prepend_metadata + metadata if prepend_me │
│ 445 │ │ ) │
│ 446 │ │ field_info._qualifiers = inspected_ann.qualif │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/pydantic/fields.py:519 in _construct │
│ │
│ 516 │ │ │ │ merged_metadata.append(meta) │
│ 517 │ │ │
│ 518 │ │ merged_kwargs.update(attr_overrides) │
│ ❱ 519 │ │ merged_field_info = cls(**merged_kwargs) │
│ 520 │ │ merged_field_info.metadata = merged_metadata │
│ 521 │ │ return merged_field_info │
│ 522 │
│ │
│ /home/shenzhe/.local/share/pipx/venvs/mcpm/lib/python3.13/si │
│ te-packages/pydantic/fields.py:232 in __init__ │
│ │
│ 229 │ │ self.default_factory = kwargs.pop('default_fa │
│ 230 │ │ │
│ 231 │ │ if self.default is not PydanticUndefined and │
│ ❱ 232 │ │ │ raise TypeError('cannot specify both defa │
│ 233 │ │ │
│ 234 │ │ self.alias = kwargs.pop('alias', None) │
│ 235 │ │ self.validation_alias = kwargs.pop('validatio │
╰──────────────────────────────────────────────────────────────╯
TypeError: cannot specify both default and default_factoryMetadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working