mirror of
https://github.com/ArthurDanjou/artapi.git
synced 2026-01-25 02:20:26 +01:00
Refactor MCP API: Remove deprecated endpoints and add new resource handlers
- Deleted old API endpoints for contact, education, experiences, hobbies, languages, profile, projects, skills, and uses. - Introduced new resource handlers for contact, education, experiences, hobbies, languages, profile, projects, skills, and uses with structured responses. - Added new MCP prompts for real-time activity, contact information, hobbies, languages, profile, projects, skills, stats, and status page. - Implemented tools for fetching real-time activity, resume links, coding stats, and weather information. - Removed legacy MCP server route and replaced it with a modular approach for better maintainability.
This commit is contained in:
31
server/mcp/resources/uses.ts
Normal file
31
server/mcp/resources/uses.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
export default defineMcpResource({
|
||||
title: 'Arthur Danjou - Tech Stack & Tools',
|
||||
description: 'A curated list of tools, software, and hardware used by Arthur Danjou, organized by categories (homelab, IDE, hardware, software)',
|
||||
uri: 'resource://artmcp/uses',
|
||||
cache: '1 hour',
|
||||
handler: async (uri: URL) => {
|
||||
const event = useEvent()
|
||||
|
||||
const categories = await queryCollection(event, 'usesCategories').where('extension', '=', 'md').all()
|
||||
|
||||
const uses = await queryCollection(event, 'uses')
|
||||
.where('extension', '=', 'md')
|
||||
.all()
|
||||
|
||||
const uses_by_categories = []
|
||||
for (const category of categories) {
|
||||
uses_by_categories.push({
|
||||
category: category,
|
||||
uses: uses.filter((use: { category: unknown }) => use.category === category.slug)
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
contents: [{
|
||||
uri: uri.toString(),
|
||||
mimeType: 'text/json',
|
||||
text: JSON.stringify(uses_by_categories, null, 2)
|
||||
}]
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user