mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
moving mcp into lib to make it available in docker setup
This commit is contained in:
@@ -159,7 +159,7 @@ Jobs run automatically at the interval you configure (see
|
|||||||
Starting with **V20**, Fredy ships with a built-in **MCP Server **. This allows you to connect Fredy to LLMs (like Claude, ChatGPT, or local models via LM Studio) and query your real estate data using natural language.
|
Starting with **V20**, Fredy ships with a built-in **MCP Server **. This allows you to connect Fredy to LLMs (like Claude, ChatGPT, or local models via LM Studio) and query your real estate data using natural language.
|
||||||
The local LLM can even enrich existing listings by checking the listing online.
|
The local LLM can even enrich existing listings by checking the listing online.
|
||||||
|
|
||||||
For more information on how to set it up and use it, please refer to the [MCP Readme](mcp/README.md).
|
For more information on how to set it up and use it, please refer to the [MCP Readme](lib/mcp/README.md).
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import { getSettings } from '../services/storage/settingsStorage.js';
|
|||||||
import { dashboardRouter } from './routes/dashboardRouter.js';
|
import { dashboardRouter } from './routes/dashboardRouter.js';
|
||||||
import { backupRouter } from './routes/backupRouter.js';
|
import { backupRouter } from './routes/backupRouter.js';
|
||||||
import { trackingRouter } from './routes/trackingRoute.js';
|
import { trackingRouter } from './routes/trackingRoute.js';
|
||||||
import { registerMcpRoutes } from '../../mcp/mcpHttpRoute.js';
|
import { registerMcpRoutes } from '../mcp/mcpHttpRoute.js';
|
||||||
const service = restana();
|
const service = restana();
|
||||||
const staticService = files(path.join(getDirName(), '../ui/public'));
|
const staticService = files(path.join(getDirName(), '../ui/public'));
|
||||||
const PORT = (await getSettings()).port || 9998;
|
const PORT = (await getSettings()).port || 9998;
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
*/
|
*/
|
||||||
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { queryJobs, getJob } from '../lib/services/storage/jobStorage.js';
|
import { queryJobs, getJob } from '../services/storage/jobStorage.js';
|
||||||
import { queryListings, getListingById } from '../lib/services/storage/listingsStorage.js';
|
import { queryListings, getListingById } from '../services/storage/listingsStorage.js';
|
||||||
import { authenticateToolCall, checkJobAccess } from './mcpAuthentication.js';
|
import { authenticateToolCall, checkJobAccess } from './mcpAuthentication.js';
|
||||||
import {
|
import {
|
||||||
normalizeListJobs,
|
normalizeListJobs,
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
* and HTTP requests. Ensures consistent access control across all transports.
|
* and HTTP requests. Ensures consistent access control across all transports.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { getUser, validateMcpToken } from '../lib/services/storage/userStorage.js';
|
import { getUser, validateMcpToken } from '../services/storage/userStorage.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authenticate an MCP tool call by extracting and validating the user from authInfo.
|
* Authenticate an MCP tool call by extracting and validating the user from authInfo.
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
||||||
import { createMcpServer } from './mcpAdapter.js';
|
import { createMcpServer } from './mcpAdapter.js';
|
||||||
import { authenticateRequest } from './mcpAuthentication.js';
|
import { authenticateRequest } from './mcpAuthentication.js';
|
||||||
import logger from '../lib/services/logger.js';
|
import logger from '../services/logger.js';
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -22,10 +22,10 @@
|
|||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
||||||
import SqliteConnection from '../lib/services/storage/SqliteConnection.js';
|
import SqliteConnection from '../services/storage/SqliteConnection.js';
|
||||||
import { runMigrations } from '../lib/services/storage/migrations/migrate.js';
|
import { runMigrations } from '../services/storage/migrations/migrate.js';
|
||||||
import { createMcpServer } from './mcpAdapter.js';
|
import { createMcpServer } from './mcpAdapter.js';
|
||||||
import { validateMcpToken } from '../lib/services/storage/userStorage.js';
|
import { validateMcpToken } from '../services/storage/userStorage.js';
|
||||||
|
|
||||||
// Ensure cwd is the project root so that relative DB/config paths resolve correctly
|
// Ensure cwd is the project root so that relative DB/config paths resolve correctly
|
||||||
// (LM Studio and other MCP hosts may spawn this process from an arbitrary directory)
|
// (LM Studio and other MCP hosts may spawn this process from an arbitrary directory)
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "fredy",
|
"name": "fredy",
|
||||||
"version": "20.0.0",
|
"version": "20.0.1",
|
||||||
"description": "[F]ind [R]eal [E]states [d]amn eas[y].",
|
"description": "[F]ind [R]eal [E]states [d]amn eas[y].",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "husky",
|
"prepare": "husky",
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
"test": "node --import ./test/esmock-loader.mjs ./node_modules/mocha/bin/mocha.js --timeout 60000 test/**/*.test.js",
|
"test": "node --import ./test/esmock-loader.mjs ./node_modules/mocha/bin/mocha.js --timeout 60000 test/**/*.test.js",
|
||||||
"testGH": "node --import ./test/esmock-loader.mjs ./node_modules/mocha/bin/mocha.js --timeout 60000 --exclude test/provider/immonet.test.js --exclude test/provider/immobilienDe.test.js --exclude test/provider/immowelt.test.js test/**/*.test.js",
|
"testGH": "node --import ./test/esmock-loader.mjs ./node_modules/mocha/bin/mocha.js --timeout 60000 --exclude test/provider/immonet.test.js --exclude test/provider/immobilienDe.test.js --exclude test/provider/immowelt.test.js test/**/*.test.js",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"mcp:stdio": "node mcp/stdio.js",
|
"mcp:stdio": "node lib/mcp/stdio.js",
|
||||||
"lint:fix": "yarn lint --fix",
|
"lint:fix": "yarn lint --fix",
|
||||||
"migratedb": "node lib/services/storage/migrations/migrate.js",
|
"migratedb": "node lib/services/storage/migrations/migrate.js",
|
||||||
"migratedb:overwrite": "x-var MIGRATION_ALLOW_CHECKSUM_UPDATE=true node lib/services/storage/migrations/migrate.js",
|
"migratedb:overwrite": "x-var MIGRATION_ALLOW_CHECKSUM_UPDATE=true node lib/services/storage/migrations/migrate.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user