Skip to content

able to analyze sprint board and sprints #36

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

Merged
merged 1 commit into from
Jul 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions src/devrev_mcp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from mcp.server import NotificationOptions, Server
from pydantic import AnyUrl
import mcp.server.stdio
from .utils import make_devrev_request
from .utils import make_devrev_request, make_internal_devrev_request

server = Server("devrev_mcp")

Expand All @@ -30,9 +30,9 @@ async def handle_list_tools() -> list[types.Tool]:
description="Fetch the current DevRev user details. When the user specifies 'me' in the query, this tool should be called to get the user details.",
inputSchema={"type": "object", "properties": {}},
),
types.Tool(
types.Tool(
name="get_vista",
description="Retrieve information about a vista in DevRev using its ID",
description="Retrieve information about a vista in DevRev using its ID. In DevRev a vista is a sprint board which contains sprints (or vista group items). The reponse of this tool will contain the sprint (or vista group item) IDs that you can use to filter on sprints.",
inputSchema={
"type": "object",
"properties": {
Expand All @@ -43,7 +43,7 @@ async def handle_list_tools() -> list[types.Tool]:
},
"required": ["id"]
},
),
),
types.Tool(
name="search",
description="Search DevRev using the provided query",
Expand Down Expand Up @@ -187,6 +187,14 @@ async def handle_list_tools() -> list[types.Tool]:
},
"required": ["after", "before"]
},
"sprint": {
"type": "array",
"items": {
"type": "string",
"description": "The DevRev ID of the sprint to filter on. In DevRev a sprint is a vista group item. You will get these IDs from the response of get vista tool."
},
"description": "Use this to filter on sprints."
}
},
"required": ["type"],
},
Expand Down Expand Up @@ -462,7 +470,7 @@ async def handle_call_tool(
if not id:
raise ValueError("Missing id ")

response = make_devrev_request(
response = make_internal_devrev_request(
"vistas.get",
{
"id": id
Expand Down Expand Up @@ -736,6 +744,10 @@ async def handle_call_tool(
if modified_date:
payload["modified_date"] = {"type": "range", "after": modified_date["after"], "before": modified_date["before"]}

sprint = arguments.get("sprint")
if sprint:
payload["issue"]["sprint"] = sprint

if payload["issue"] == {}:
payload.pop("issue")

Expand Down
29 changes: 29 additions & 0 deletions src/devrev_mcp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,32 @@ def make_devrev_request(endpoint: str, payload: Dict[str, Any]) -> requests.Resp
headers=headers,
json=payload
)

def make_internal_devrev_request(endpoint: str, payload: Dict[str, Any]) -> requests.Response:
"""
Make an authenticated request to the DevRev API.

Args:
endpoint: The API endpoint path (e.g., "works.get" or "search.hybrid")
payload: The JSON payload to send

Returns:
requests.Response object

Raises:
ValueError: If DEVREV_API_KEY environment variable is not set
"""
api_key = os.environ.get("DEVREV_API_KEY")
if not api_key:
raise ValueError("DEVREV_API_KEY environment variable is not set")

headers = {
"Authorization": f"{api_key}",
"Content-Type": "application/json",
}

return requests.post(
f"https://api.devrev.ai/internal/{endpoint}",
headers=headers,
json=payload
)