mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-15 05:45:20 +00:00
fix(mcp): Remove logs interfering with the stdio transport (#429)
This commit is contained in:
parent
b46fb53954
commit
821c6ba895
3 changed files with 3 additions and 4 deletions
|
|
@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed issue where console logs were resulting in "unexpected token" errors on the MCP client. [#429](https://github.com/sourcebot-dev/sourcebot/pull/429)
|
||||||
|
|
||||||
## [1.0.3] - 2025-06-18
|
## [1.0.3] - 2025-06-18
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import { FileSourceRequest, FileSourceResponse, ListRepositoriesResponse, Search
|
||||||
import { isServiceError } from './utils.js';
|
import { isServiceError } from './utils.js';
|
||||||
|
|
||||||
export const search = async (request: SearchRequest): Promise<SearchResponse | ServiceError> => {
|
export const search = async (request: SearchRequest): Promise<SearchResponse | ServiceError> => {
|
||||||
console.debug(`Executing search request: ${JSON.stringify(request, null, 2)}`);
|
|
||||||
const result = await fetch(`${env.SOURCEBOT_HOST}/api/search`, {
|
const result = await fetch(`${env.SOURCEBOT_HOST}/api/search`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
|
|
@ -75,8 +75,6 @@ server.tool(
|
||||||
query += ` case:no`;
|
query += ` case:no`;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.debug(`Executing search request: ${query}`);
|
|
||||||
|
|
||||||
const response = await search({
|
const response = await search({
|
||||||
query,
|
query,
|
||||||
matches: env.DEFAULT_MATCHES,
|
matches: env.DEFAULT_MATCHES,
|
||||||
|
|
@ -214,7 +212,6 @@ server.tool(
|
||||||
const runServer = async () => {
|
const runServer = async () => {
|
||||||
const transport = new StdioServerTransport();
|
const transport = new StdioServerTransport();
|
||||||
await server.connect(transport);
|
await server.connect(transport);
|
||||||
console.info('Sourcebot MCP server ready');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
runServer().catch((error) => {
|
runServer().catch((error) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue