Skip to content

feat: add MCP (Model Context Protocol) server for elmclient#127

Open
filhocf wants to merge 3 commits intoIBM:masterfrom
filhocf:feature/mcp-server
Open

feat: add MCP (Model Context Protocol) server for elmclient#127
filhocf wants to merge 3 commits intoIBM:masterfrom
filhocf:feature/mcp-server

Conversation

@filhocf
Copy link
Copy Markdown

@filhocf filhocf commented Mar 26, 2026

Summary

Adds a built-in MCP (Model Context Protocol) server that exposes elmclient functionality as tools for AI assistants (Claude, GPT, Copilot, etc.).

Closes #125

What is MCP?

Model Context Protocol is an open standard for connecting AI assistants to external tools and data sources. It's supported by Claude, VS Code Copilot, and many other AI tools.

Changes

  • elmclient/mcp_server.py — MCP server with 3 tools:

    • list_projects(domain) — List accessible projects (ccm/rm/qm)
    • list_workitems(project, query, pagesize) — Query work items via OSLC
    • get_workitem(project, id) — Get work item details
  • setup.py — Added:

    • extras_require={"mcp": ["mcp[cli]"]} — Optional dependency
    • elm-mcp-server console_scripts entry point

Installation

pip install 'elmclient[mcp]'

Configuration

Via environment variables:

export ELM_HOST=https://your-elm-server.com
export ELM_USER=username
export ELM_PASSWORD=password
elm-mcp-server

Or via ~/.elm_credentials.json:

{"host": "https://...", "username": "...", "password": "..."}

MCP Client Configuration

{
  "mcpServers": {
    "elm": {
      "command": "elm-mcp-server",
      "env": {
        "ELM_HOST": "https://your-elm-server.com",
        "ELM_USER": "username",
        "ELM_PASSWORD": "password"
      }
    }
  }
}

Notes

  • MCP dependency is optional — existing users are not affected
  • Follows the same patterns as existing elmclient code
  • Tested with a production ELM instance

filhocf added 2 commits March 26, 2026 13:31
Adds a built-in MCP server that exposes ELM functionality as tools
for AI assistants (Claude, GPT, Copilot, etc.).

Tools provided:
- list_projects: List accessible projects (ccm/rm/qm)
- list_workitems: Query work items via OSLC
- get_workitem: Get work item details

Configuration via environment variables or ~/.elm_credentials.json.

Closes IBM#125

Signed-off-by: Claudio Ferreira Filho <filhocf@gmail.com>
- Add 'mcp' extras_require for optional MCP support
- Add 'elm-mcp-server' console_scripts entry point
- Install with: pip install 'elmclient[mcp]'

Signed-off-by: Claudio Ferreira Filho <filhocf@gmail.com>
@filhocf filhocf force-pushed the feature/mcp-server branch from a23426e to b1d69e5 Compare March 26, 2026 16:32
@filhocf
Copy link
Copy Markdown
Author

filhocf commented Apr 30, 2026

@barny gentle ping — this PR adds an MCP server for elmclient (3 tools: list_projects, list_workitems, get_workitem). We've been running it in production daily against our ELM instance. Happy to address any feedback.

Also, heads up on #131 — the represt CLI broke in 0.37.1 (AMApp.add_represt_arguments missing). Doesn't affect the library API, but might want a patch release.

Move mcp_server.py to examples/elm_mcp_server.py as requested by
@barny in IBM#125. This follows the project convention where all
executable tools live in the examples/ directory.

- Renamed: elmclient/mcp_server.py → elmclient/examples/elm_mcp_server.py
- Updated entry point: elm-mcp-server → elmclient.examples.elm_mcp_server:main
- No functional changes to the server code

Signed-off-by: Claudio Ferreira Filho <filhocf@gmail.com>
@filhocf
Copy link
Copy Markdown
Author

filhocf commented Apr 30, 2026

Moved per your feedback in #125:

  • elmclient/mcp_server.pyelmclient/examples/elm_mcp_server.py
  • Entry point updated: elm-mcp-server=elmclient.examples.elm_mcp_server:main

Follows the same pattern as oslcquery, batchquery, etc. No functional changes.

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.

Feature request: MCP (Model Context Protocol) server for elmclient

1 participant