From 11311bc2875212ad15ec9225fe8e87c454ec7e88 Mon Sep 17 00:00:00 2001 From: Arthur DANJOU Date: Fri, 14 Nov 2025 12:44:37 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20ajouter=20la=20gestion=20de=20l'=C3=A9d?= =?UTF-8?q?ucation=20avec=20des=20fichiers=20de=20configuration=20et=20des?= =?UTF-8?q?=20ressources=20associ=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content.config.ts | 11 +++ content/education/bachelor.md | 7 ++ content/education/m1.md | 7 ++ content/education/m2.md | 7 ++ server/api/educations.get.ts | 12 +++ server/routes/mcp.ts | 138 +++++++++++++++++++++++++++++++++- 6 files changed, 180 insertions(+), 2 deletions(-) create mode 100644 content/education/bachelor.md create mode 100644 content/education/m1.md create mode 100644 content/education/m2.md create mode 100644 server/api/educations.get.ts diff --git a/content.config.ts b/content.config.ts index 43dfcb1..9cd44f5 100644 --- a/content.config.ts +++ b/content.config.ts @@ -60,6 +60,17 @@ export default defineContentConfig({ description: z.string(), tags: z.array(z.string()) }) + }), + education: defineCollection({ + type: 'data', + source: 'education/*.md', + schema: z.object({ + degree: z.string(), + institution: z.string(), + startDate: z.string(), + endDate: z.string().optional(), + location: z.string() + }) }) } }) diff --git a/content/education/bachelor.md b/content/education/bachelor.md new file mode 100644 index 0000000..cd605d5 --- /dev/null +++ b/content/education/bachelor.md @@ -0,0 +1,7 @@ +--- +degree: Bachelor's Degree in Mathematics +institution: Paris-Saclay University +location: Paris, France +startDate: 2021-09 +endDate: 2024-06 +--- \ No newline at end of file diff --git a/content/education/m1.md b/content/education/m1.md new file mode 100644 index 0000000..04e89ee --- /dev/null +++ b/content/education/m1.md @@ -0,0 +1,7 @@ +--- +degree: First year Master's Degree in Applied Mathematics +institution: Paris Dauphine-PSL University +location: Paris, France +startDate: 2023-09 +endDate: 2024-06 +--- \ No newline at end of file diff --git a/content/education/m2.md b/content/education/m2.md new file mode 100644 index 0000000..79038e7 --- /dev/null +++ b/content/education/m2.md @@ -0,0 +1,7 @@ +--- +degree: Second year Master's Degree in Applied Mathematics +institution: Paris Dauphine-PSL University +location: Paris, France +startDate: 2024-09 +endDate: 2025-10 +--- \ No newline at end of file diff --git a/server/api/educations.get.ts b/server/api/educations.get.ts new file mode 100644 index 0000000..099bd55 --- /dev/null +++ b/server/api/educations.get.ts @@ -0,0 +1,12 @@ +import { queryCollection } from '@nuxt/content/server' + +export default defineCachedEventHandler(async (event) => { + return { + body: await queryCollection(event, 'education') + .where('extension', '=', 'md') + .all() + } +}, { + name: 'educations-list', + maxAge: 3600 // 1 hour +}) diff --git a/server/routes/mcp.ts b/server/routes/mcp.ts index a444565..ebc6519 100644 --- a/server/routes/mcp.ts +++ b/server/routes/mcp.ts @@ -1,5 +1,6 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js' import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js' +import { z } from '@nuxt/content' function createServer() { const server = new McpServer({ @@ -7,9 +8,142 @@ function createServer() { version: '1.0.0' }) + // Ressources + server.registerResource( + 'artmcp-skills', + 'resource://artmcp/skills', + { + title: 'ArtMCP Skills', + description: 'Complete list of skills of Arthur Danjou' + }, + async (uri) => { + const result = await $fetch('/api/skills') + return { + contents: [{ + uri: uri.href, + mimeType: 'application/json', + text: JSON.stringify(result, null, 2) + }] + } + } + ) + + server.registerResource( + 'artmcp-experiences', + 'resource://artmcp/experiences', + { + title: 'ArtMCP Experiences', + description: 'Complete list of experiences of Arthur Danjou' + }, + async (uri) => { + const result = await $fetch('/api/experiences') + return { + contents: [{ + uri: uri.href, + mimeType: 'application/json', + text: JSON.stringify(result, null, 2) + }] + } + } + ) + + server.registerResource( + 'artmcp-projects', + 'resource://artmcp/projects', + { + title: 'ArtMCP Projects', + description: 'Complete list of projects of Arthur Danjou' + }, + async (uri) => { + const result = await $fetch('/api/projects') + return { + contents: [{ + uri: uri.href, + mimeType: 'application/json', + text: JSON.stringify(result, null, 2) + }] + } + } + ) + + server.registerResource( + 'artmcp-uses', + 'resource://artmcp/uses', + { + title: 'ArtMCP Uses', + description: 'Complete list of uses of Arthur Danjou filtered by categories' + }, + async (uri) => { + const result = await $fetch('/api/uses') + return { + contents: [{ + uri: uri.href, + mimeType: 'application/json', + text: JSON.stringify(result, null, 2) + }] + } + } + ) + + server.registerResource( + 'artmcp-education', + 'resource://artmcp/education', + { + title: 'ArtMCP Education', + description: 'Complete list of education of Arthur Danjou' + }, + async (uri) => { + const result = await $fetch('/api/educations') + return { + contents: [{ + uri: uri.href, + mimeType: 'application/json', + text: JSON.stringify(result, null, 2) + }] + } + } + ) + + // Tools + server.registerTool( + 'get_resume_link', + { + title: 'Get Resume Link', + description: 'Provide a link to download Arthur Danjou\'s resume in the requested language.', + inputSchema: { + lang: z.enum(['en', 'fr']).describe('The language for the resume, \'en\' or \'fr\'.') + } + }, + async ({ lang }) => { + const url = `https://mcp.arthurdanjou.fr/api/resumes/${lang}` + return { + content: [{ type: 'text', text: JSON.stringify(url, null, 2) }] + } + } + ) + // Prompts : toutes les commandes de artchat - // Ressources : toutes les ressources de Nuxt Content - // Tools : toutes les actions + server.registerPrompt( + 'artmcp-resume', + { + title: 'Get Resume of Arthur Danjou', + description: 'Get Resume in French or English format of Arthur Danjou', + argsSchema: { + lang: z.enum(['en', 'fr']).describe('The language for the resume, \'en\' or \'fr\'.') + } + }, + async ({ lang }) => { + return { + messages: [{ + role: 'user', + content: { + type: 'text', + text: `Provide me the link to download Arthur Danjou's resume in ${lang === 'en' ? 'English' : 'French'}.` + } + }] + } + } + ) return server }