mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2024-12-22 18:16:52 +03:00
Update dockerfiles for npx versions, gdrive env credential paths
This commit is contained in:
@@ -6,11 +6,14 @@ COPY src/filesystem /app
|
||||
COPY tsconfig.json /tsconfig.json
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm npm install
|
||||
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
|
||||
|
||||
|
||||
FROM node:22-alpine AS release
|
||||
|
||||
COPY --from=builder /app/dist /app
|
||||
|
||||
COPY --from=builder /app/node_modules /app/node_modules
|
||||
ENV NODE_ENV=production
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -7,12 +7,15 @@ WORKDIR /app
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm npm install
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
|
||||
|
||||
FROM node:22-alpine AS release
|
||||
|
||||
COPY --from=builder /app/dist /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/dist /app/dist
|
||||
COPY --from=builder /app/node_modules /app/node_modules
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
CMD ["node", "dist/index.js"]
|
||||
@@ -56,7 +56,7 @@ To integrate this server with the desktop app, add the following to your app's s
|
||||
"mcpServers": {
|
||||
"gdrive": {
|
||||
"command": "docker",
|
||||
"args": ["run", "-i", "--rm", "ai/mcp-gdrive"]
|
||||
"args": ["run", "-i", "--rm", "--mount", "type=bind,source=/Users/colinmcneil/Desktop/gcp-oauth.keys.json,target=/gcp-oauth.keys.json", "-v", "mcp-gdrive:/gdrive-server", "-e", "GDRIVE_OAUTH_PATH=/gcp-oauth.keys.json", "-e", "GDRIVE_CREDENTIALS_PATH=/gdrive-server/credentials.json", "ai/mcp-gdrive"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,13 +152,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
const userQuery = request.params.arguments?.query as string;
|
||||
const escapedQuery = userQuery.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
|
||||
const formattedQuery = `fullText contains '${escapedQuery}'`;
|
||||
|
||||
|
||||
const res = await drive.files.list({
|
||||
q: formattedQuery,
|
||||
pageSize: 10,
|
||||
fields: "files(id, name, mimeType, modifiedTime, size)",
|
||||
});
|
||||
|
||||
|
||||
const fileList = res.data.files
|
||||
?.map((file: any) => `${file.name} (${file.mimeType})`)
|
||||
.join("\n");
|
||||
@@ -175,7 +175,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
||||
throw new Error("Tool not found");
|
||||
});
|
||||
|
||||
const credentialsPath = path.join(
|
||||
const credentialsPath = process.env.GDRIVE_CREDENTIALS_PATH || path.join(
|
||||
path.dirname(new URL(import.meta.url).pathname),
|
||||
"../../../.gdrive-server-credentials.json",
|
||||
);
|
||||
@@ -185,7 +185,7 @@ async function authenticateAndSaveCredentials() {
|
||||
const auth = await authenticate({
|
||||
keyfilePath: path.join(
|
||||
path.dirname(new URL(import.meta.url).pathname),
|
||||
"../../../gcp-oauth.keys.json",
|
||||
process.env.GDRIVE_OAUTH_PATH || "../../../gcp-oauth.keys.json",
|
||||
),
|
||||
scopes: ["https://www.googleapis.com/auth/drive.readonly"],
|
||||
});
|
||||
|
||||
@@ -8,9 +8,12 @@ WORKDIR /app
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm npm install
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
|
||||
|
||||
FROM node:22-alpine AS release
|
||||
|
||||
COPY --from=builder /app/dist /app
|
||||
COPY --from=builder /app/node_modules /app/node_modules
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
|
||||
@@ -7,9 +7,12 @@ WORKDIR /app
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm npm install
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
|
||||
|
||||
FROM node:22-alpine AS release
|
||||
|
||||
COPY --from=builder /app/dist /app
|
||||
COPY --from=builder /app/node_modules /app/node_modules
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
|
||||
@@ -8,9 +8,12 @@ WORKDIR /app
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm npm install
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
|
||||
|
||||
FROM node:22-alpine AS release
|
||||
|
||||
COPY --from=builder /app/dist /app
|
||||
COPY --from=builder /app/node_modules /app/node_modules
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
|
||||
@@ -7,9 +7,12 @@ WORKDIR /app
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm npm install
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
|
||||
|
||||
FROM node:22-alpine AS release
|
||||
|
||||
COPY --from=builder /app/dist /app
|
||||
COPY --from=builder /app/node_modules /app/node_modules
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
|
||||
@@ -7,10 +7,12 @@ WORKDIR /app
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm npm install
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
|
||||
|
||||
FROM node:22-alpine AS release
|
||||
|
||||
COPY --from=builder /app/dist /app
|
||||
|
||||
COPY --from=builder /app/node_modules /app/node_modules
|
||||
ENV NODE_ENV=production
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -7,9 +7,12 @@ WORKDIR /app
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm npm install
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
|
||||
|
||||
FROM node:22-alpine AS release
|
||||
|
||||
COPY --from=builder /app/dist /app
|
||||
COPY --from=builder /app/node_modules /app/node_modules
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
|
||||
@@ -8,9 +8,12 @@ WORKDIR /app
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm npm install
|
||||
|
||||
RUN --mount=type=cache,target=/root/.npm-production npm ci --ignore-scripts --omit-dev
|
||||
|
||||
FROM node:22-alpine AS release
|
||||
|
||||
COPY --from=builder /app/dist /app
|
||||
COPY --from=builder /app/node_modules /app/node_modules
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
|
||||
Reference in New Issue
Block a user