Skip to content

Add stateless MCP server to API#352

Merged
mbklein merged 1 commit intodeploy/stagingfrom
add-mcp-server
Mar 20, 2026
Merged

Add stateless MCP server to API#352
mbklein merged 1 commit intodeploy/stagingfrom
add-mcp-server

Conversation

@mbklein
Copy link
Copy Markdown
Contributor

@mbklein mbklein commented Mar 16, 2026

This PR adds an MCP server at /api/v2/mcp. Testing it is a little tricky but doable on your local machine (not remote dev environment).

  1. cd mcp && npm ci
  2. Make sure your .bash_profile properly initializes mise or asdf or whatever local package manager you use. (It is not sufficient that .zprofile or .zshrc does it, since the MCP server launches under bash and not zsh.)
  3. Make sure you have nodejs v24.11.1 installed using the aforementioned package manager.
  4. Make sure Claude Desktop is not running.
  5. Edit ~/Library/Application Support/Claude/claude_desktop_config.json. Create it if it doesn't exist.
  6. Add the following:
    {
      "mcpServers": {
        "dc-api": {
          "command": "/path/to/dc-api-v2/mcp/bin/run.sh",
          "environment": {
            "SEARCH_MODEL_ID": "PROD_OPENSEARCH_MODEL_ID"
          }
        }
      }
    }
    You can get the prod opensearch model ID out of the production/infrastructure/index secret in AWS.

You can now launch Claude and ask about content from Digital Collections. Expand the tool calls to see requests and responses. Go to Settings > Connectors > dc-api > Configure to see a list of tools and permissions.

@mbklein mbklein force-pushed the add-mcp-server branch 6 times, most recently from ae4d16e to bb2524c Compare March 18, 2026 16:41
@mbklein mbklein requested review from bmquinn and kdid March 18, 2026 17:02
@mbklein mbklein force-pushed the add-mcp-server branch 2 times, most recently from 47d33f2 to 203a05a Compare March 18, 2026 20:03
mcp/bin/run.sh Outdated
@@ -0,0 +1,6 @@
#!/bin/bash
export HOME="${HOME:-/Users/mbk836}"
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.

@mbklein - I'm confused about your testing instructions. Am I supposed to edit this file first?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Whoops, nice catch. I'll update that.

@mbklein mbklein force-pushed the add-mcp-server branch 2 times, most recently from d7cfb0b to 1f7d7ae Compare March 19, 2026 21:49
Use @nulib/clover-mcp for MCP UI resource

Add view-search-results tool
Combine search and semantic-search tools

Add source maps to MCP

Add MCP tests

Update to use new visibility / auth filtering in DCAPI
Copy link
Copy Markdown
Contributor

@bmquinn bmquinn left a comment

Choose a reason for hiding this comment

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

Looks great, and I think we should handle any issues that surfaced like the erroring pagination in search results upstream from the MCP server implementation.

@mbklein mbklein merged commit 78ac643 into deploy/staging Mar 20, 2026
2 checks passed
@mbklein mbklein deleted the add-mcp-server branch March 20, 2026 21:08
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