Skip to content

Commit 8d52970

Browse files
committed
fix server names and add another thing
1 parent 96b2b3b commit 8d52970

File tree

3 files changed

+53
-10
lines changed

3 files changed

+53
-10
lines changed

app/routes/mcp+/mcp.server.ts

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const server = new McpServer(
1919
)
2020

2121
server.tool(
22-
'Find User',
22+
'find_user',
2323
'Search for users in the Epic Notes database by their name or username',
2424
{ query: z.string().describe('The query to search for') },
2525
async ({ query }) => {
@@ -51,6 +51,49 @@ server.tool(
5151
},
5252
)
5353

54+
server.tool(
55+
'get_user_notes',
56+
'Get the notes for a user',
57+
{
58+
username: z.string().describe('The username of the user to get notes for'),
59+
},
60+
async ({ username }) => {
61+
const user = await prisma.user.findUnique({
62+
where: { username },
63+
select: {
64+
notes: {
65+
select: {
66+
id: true,
67+
title: true,
68+
content: true,
69+
},
70+
take: 10,
71+
},
72+
},
73+
})
74+
if (!user) {
75+
return {
76+
content: [{ type: 'text', text: 'User not found' }],
77+
}
78+
}
79+
80+
const { notes } = user
81+
82+
if (!notes?.length) {
83+
return {
84+
content: [{ type: 'text', text: 'No notes found' }],
85+
}
86+
}
87+
88+
return {
89+
content: notes.map((note) => ({
90+
type: 'text',
91+
text: `${note.title}\n\n${note.content}`,
92+
})),
93+
}
94+
},
95+
)
96+
5497
async function getUserBase64Image(imageObjectKey: string) {
5598
const { url: signedUrl, headers: signedHeaders } =
5699
getSignedGetRequestInfo(imageObjectKey)

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@epic-web/totp": "^4.0.1",
5252
"@mjackson/form-data-parser": "^0.7.0",
5353
"@mjackson/headers": "^0.10.0",
54-
"@modelcontextprotocol/sdk": "^1.8.0",
54+
"@modelcontextprotocol/sdk": "^1.9.0",
5555
"@nasa-gcn/remix-seo": "^2.0.1",
5656
"@nichtsam/helmet": "0.3.0",
5757
"@oslojs/crypto": "^1.0.1",

0 commit comments

Comments
 (0)