Skip to content

Commit 417c747

Browse files
committed
refactor: remove markdown loaders and related tools
- Deleted markdown-loader.ts and markdown-tools.ts as part of the transition to a definition-first architecture. - Removed markdown-related functions and interfaces from the codebase. - Updated package.json to exclude markdown-related files. - Adjusted db-definition-loader.ts to reflect changes in file paths. - Updated index.ts to remove references to markdown tools and enhance server description. - Added TypeScript declaration generation in tsconfig.json.
1 parent 928c9fb commit 417c747

File tree

8 files changed

+14
-1201
lines changed

8 files changed

+14
-1201
lines changed

.changeset/angry-dolls-warn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'mcp-svelte-docs': patch
3+
---
4+
5+
remove markdown loaders from package tools

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
},
1111
"files": [
1212
"dist",
13-
"definitions",
14-
"docs",
1513
"README.md",
1614
"LICENSE"
1715
],

src/db-definition-loader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ let db: Database.Database | null = null;
2424
*/
2525
function initDb(): Database.Database {
2626
if (!db) {
27-
const dbPath = join(__dirname, '../definitions.db');
27+
const dbPath = join(__dirname, 'definitions.db');
2828
db = Database(dbPath, { readonly: true });
2929
}
3030
return db;
@@ -192,4 +192,4 @@ export function closeDb(): void {
192192
// Cleanup on process exit
193193
process.on('exit', closeDb);
194194
process.on('SIGINT', closeDb);
195-
process.on('SIGTERM', closeDb);
195+
process.on('SIGTERM', closeDb);

src/definition-loader.ts

Lines changed: 0 additions & 218 deletions
This file was deleted.

src/index.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { dirname, join } from 'node:path';
99
import { fileURLToPath } from 'node:url';
1010

1111
import { get_config } from './config.js';
12-
import { register_markdown_tools } from './tools/markdown-tools.js';
1312
import { register_definition_tools } from './tools/definition-tools.js';
1413

1514
// Get package info for server metadata
@@ -22,6 +21,7 @@ const { name, version } = pkg;
2221

2322
/**
2423
* Main class for the Svelte Docs MCP server
24+
* Pure definition-first architecture using SQLite database
2525
*/
2626
class SvelteDocsServer {
2727
private server: McpServer<any>;
@@ -36,7 +36,7 @@ class SvelteDocsServer {
3636
{
3737
name,
3838
version,
39-
description: 'MCP server for Svelte docs',
39+
description: 'MCP server for Svelte docs - Definition-first architecture',
4040
},
4141
{
4242
adapter: this.adapter,
@@ -74,21 +74,18 @@ class SvelteDocsServer {
7474
}
7575

7676
/**
77-
* Initialize the server
77+
* Initialize the server with definition tools only
7878
*/
7979
private async initialize(): Promise<void> {
8080
try {
8181
// Load configuration
8282
const config = get_config();
8383
console.error('Svelte Docs MCP server initialized');
8484

85-
// Register definition tools (new primary interface)
85+
// Register definition tools (single svelte_definition tool)
8686
register_definition_tools(this.server);
8787

88-
// Register markdown-based tools (legacy/tutorial interface)
89-
register_markdown_tools(this.server);
90-
91-
console.error('All tools registered');
88+
console.error('Definition tools registered - Pure database architecture');
9289
} catch (error) {
9390
console.error('Failed to initialize server:', error);
9491
process.exit(1);
@@ -120,4 +117,4 @@ const server = new SvelteDocsServer();
120117
server.run().catch((error) => {
121118
console.error('Unhandled error:', error);
122119
process.exit(1);
123-
});
120+
});

0 commit comments

Comments
 (0)