8000 Fix/mcp server tools by AlbertDeFusco · Pull Request #122 · anaconda/anaconda-ai · GitHub
[go: up one dir, main page]

Skip to content

Fix/mcp server tools - #122

Merged
AlbertDeFusco merged 4 commits into
mainfrom
fix/mcp-server-tools
May 8, 2026
Merged

AlbertDeFusco merged 4 commits into
mainfrom
fix/mcp-server-tools

Conversation

@AlbertDeFusco
Copy link
Copy Markdown
Collaborator
  • improved listing tools to correctly pick up if there are running servers and if the model has been downloaded
  • added tool to download models
  • add support for optional params in server creation (mostly useful for Anaconda Desktop backend)

@AlbertDeFusco
AlbertDeFusco requested a review from romulorosa May 7, 2026 16:26
from mcp.server.fastmcp import FastMCP
except ImportError:
raise ImportError(
"MCP server requires the mcp package. Install with: pip install 'anaconda-ai[mcp]'"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Outside of the scope of the PR, but should we consider replacing pip install with conda install :)



@mcp.tool()
def download_model(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A good candidate for long-running tasks once the clients start supporting it

Comment on lines +177 to +178
if opts is None:
opts = {}
@romulorosa romulorosa May 8, 2026 •
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nitpick: I might be missing something, but perhaps you could eliminate this check if, instead, you do something like:

opts: dict[str, Any] = extra_options.copy() if extra_options else {}

@romulorosa romulorosa left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM! 👍🏼

@AlbertDeFusco
AlbertDeFusco added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit 4fb105e May 8, 2026
8 checks passed
@AlbertDeFusco
AlbertDeFusco deleted the fix/mcp-server-tools branch May 8, 2026 16:54
model_name, extra_options, anaconda_client
)
self._client = openai_client
object.__setattr__(self, "_client", openai_client)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what is setattr needed for?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

In the upstream OpenAIChatModel class .client and ._client are implemented as readonly @property mypy complains when I tried to assign the the attribute. Maybe an ignore would be better?

Optionally pass backend/site. If name is provided it may be used as server name (backend-dependent).
Downloads the model if needed, then starts the server. Returns server_id, model, status, openai_url.

extra_options: Optional dict of server configuration. The AI Navigator backend supports
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should probably audit the use of AI Navigator and replace all instances with Anaconda Desktop

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

i'm getting telemetry working quite soon and we'll be able to get this information

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.

3 participants

0