Skip to content

Initial MCP server config schema and loader #1377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 0 commits into from

Conversation

ellisonbg
Copy link
Contributor

This PR build on top of #1376 by adding support for loading MCP server configuration from a JSON file in the .jupyter directory. This PR has two components:

  1. A JSON schema for the MCP server configuration file. This schema follows the patterns established by Anthropic, Cursor, Cline, etc.
  2. A loader that takes a path to an MCP config file, reads the JSON data, validates it against the schema, and then returns it to the caller.

This doesn't yet wire everything up and isn't fully ready for full review. Would love initial comments and feedback though.

Comment on lines 410 to 416

def _link_jupyter_server_extension(self, server_app):
"""Setup custom config needed by this extension."""
c = Config()
c.ContentsManager.allow_hidden = True
server_app.update_config(c)
super()._link_jupyter_server_extension(server_app)
Copy link
Member

Choose a reason for hiding this comment

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

Just curious, what is the motivation for setting this globally? Is it so that users can see .jupyter from the JupyterLab UI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, otherwise there is no way for users to view and edit files in .jupyter.

except json.JSONDecodeError as e:
raise json.JSONDecodeError(
f"Invalid JSON in config file {config_path}: {e.msg}", e.doc, e.pos
)

Choose a reason for hiding this comment

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

optional: from e ?

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