Skip to content

initial apphosting mcp tool #8605

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

initial apphosting mcp tool #8605

wants to merge 6 commits into from

Conversation

bkendall
Copy link
Contributor

Description

Adds an initial MCP tool for App Hosting.

This combines the Backend and it's singleton Traffic resource into one so that the LLM can make some inferences about the traffic information!

Scenarios Tested

Sample Commands

if (!projectId) return NO_PROJECT_ERROR;
if (!location) location = "-";
const data: (Backend & { traffic: Traffic })[] = [];
const backends = await listBackends(projectId, location);
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want a different message for no backends - ie

Suggested change
const backends = await listBackends(projectId, location);
const backends = await listBackends(projectId, location);
if (!backends.length) return toContent("No backends exist on project ${projectId} ${location !== "-" ? `in ${location}` :""}

Not sure what the LLMs will like more

},
},
async ({ location } = {}, { projectId }) => {
if (!projectId) return NO_PROJECT_ERROR;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is already taken care of by the caller.

if (tool.mcp._meta?.requiresProject && !projectId) return NO_PROJECT_ERROR;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, but I still have to assert that projectId isn't undefined, otherwise I have to do checks all over the place. Does this hurt that much to bother?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it's a bit annoying that projectId is nullable even if requiresProject is true above.

Maybe we can do a clean up to supply a dummy projectId: "missing-project" if there there is no project present.

@bkendall bkendall requested a review from joehan May 19, 2025 19:03
Copy link
Contributor

@fredzqm fredzqm left a comment

Choose a reason for hiding this comment

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

Looks good to me

I'd defer to @joehan on when the code freeze ends and we are ready to adding more tools~

@github-project-automation github-project-automation bot moved this from Approved [PR] to Changes Requested [PR] in [Cloud] Extensions + Functions May 19, 2025
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