Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
cocktailpeanut committed Nov 28, 2024
0 parents commit 100015e
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 0 deletions.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions install.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
module.exports = {
run: [
{
method: "shell.run",
params: {
venv: "env", // Edit this to customize the venv folder path
message: [
"conda install -y conda-forge::uv"
],
}
},
{
method: "shell.run",
params: {
message: "mkdir {{kernel.path('MCP')}}"
}
},
{
method: "shell.run",
params: {
message: [
"npm install",
"node index {{kernel.path('MCP/test.db')}}"
],
path: "sqlite"
}
},
{
when: "{{platform === 'darwin'}}",
method: "fs.write",
params: {
path: "{{env.HOME}}/Library/Application Support/Claude/claude_desktop_config.json",
json2: {
"mcpServers": {
"sqlite": {
"command": "uvx",
"env": {
"HOME": "{{kernel.envs.HOME}}",
"PATH": "{{kernel.envs.PATH}}",
},
"args": [
"mcp-server-sqlite",
"--db-path",
"{{kernel.path('MCP/test.db')}}"
]
}
}
}
}
},
{
when: "{{platform === 'win32'}}",
method: "fs.write",
params: {
path: "{{path.resolve(env.APPDATA, 'Claude/claude_desktop_config.json')}}",
json2: {
"mcpServers": {
"sqlite": {
"command": "uvx",
"env": {
"HOME": "{{kernel.envs.HOME}}",
"PATH": "{{kernel.envs.PATH}}",
},
"args": [
"mcp-server-sqlite",
"--db-path",
"{{kernel.path('MCP/test.db')}}"
]
}
}
}
}
}
]
}
12 changes: 12 additions & 0 deletions pinokio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const path = require('path')
module.exports = {
version: "2.2",
title: "MCP",
description: "",
icon: "icon.png",
menu: [{
icon: "fa-solid fa-plug",
text: "Install",
href: "install.js",
}]
}
76 changes: 76 additions & 0 deletions sqlite/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
const sqlite3 = require('sqlite3').verbose();
const path = require('path');

// Define the database path
const dbPath = process.argv[2];

// Open the database (it will be created if it doesn't exist)
const db = new sqlite3.Database(dbPath, (err) => {
if (err) {
console.error('Error opening database:', err.message);
} else {
console.log(`Connected to the database at ${dbPath}`);
}
});

// SQL statements
const createTableSQL = `
CREATE TABLE IF NOT EXISTS products (
id INTEGER PRIMARY KEY,
name TEXT,
price REAL
);`;

const insertProductsSQL = `
INSERT INTO products (name, price) VALUES
('Widget', 19.99),
('Gadget', 29.99),
('Gizmo', 39.99),
('Smart Watch', 199.99),
('Wireless Earbuds', 89.99),
('Portable Charger', 24.99),
('Bluetooth Speaker', 79.99),
('Phone Stand', 15.99),
('Laptop Sleeve', 34.99),
('Mini Drone', 299.99),
('LED Desk Lamp', 45.99),
('Keyboard', 129.99),
('Mouse Pad', 12.99),
('USB Hub', 49.99),
('Webcam', 69.99),
('Screen Protector', 9.99),
('Travel Adapter', 27.99),
('Gaming Headset', 159.99),
('Fitness Tracker', 119.99),
('Portable SSD', 179.99);
`;

// Execute SQL statements
db.serialize(() => {
// Create the table
db.run(createTableSQL, (err) => {
if (err) {
console.error('Error creating table:', err.message);
} else {
console.log('Table created successfully.');
}
});

// Insert data
db.run(insertProductsSQL, (err) => {
if (err) {
console.error('Error inserting data:', err.message);
} else {
console.log('Data inserted successfully.');
}
});
});

// Close the database
db.close((err) => {
if (err) {
console.error('Error closing database:', err.message);
} else {
console.log('Database connection closed.');
}
});
14 changes: 14 additions & 0 deletions sqlite/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "sqlite",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"sqlite3": "^5.1.7"
}
}
8 changes: 8 additions & 0 deletions update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
run: [{
method: "shell.run",
params: {
message: "git pull"
}
}]
}

0 comments on commit 100015e

Please sign in to comment.